| Index: chrome/browser/resources/options/chromeos/display_options.js
|
| diff --git a/chrome/browser/resources/options/chromeos/display_options.js b/chrome/browser/resources/options/chromeos/display_options.js
|
| index df1e0f26b475fc0aab10855868cbca448e9b52c2..71a54ba7772f5dc2a375d273b98fd6733c316e1b 100644
|
| --- a/chrome/browser/resources/options/chromeos/display_options.js
|
| +++ b/chrome/browser/resources/options/chromeos/display_options.js
|
| @@ -212,10 +212,10 @@ cr.define('options', function() {
|
| // position changes slightly even though the user doesn't think to move
|
| // the finger, very small move is just ignored.
|
| /** @const */ var IGNORABLE_TOUCH_MOVE_PX = 1;
|
| - var x_diff = Math.abs(touchLocation.x - this.lastTouchLocation_.x);
|
| - var y_diff = Math.abs(touchLocation.y - this.lastTouchLocation_.y);
|
| - if (x_diff <= IGNORABLE_TOUCH_MOVE_PX &&
|
| - y_diff <= IGNORABLE_TOUCH_MOVE_PX) {
|
| + var xDiff = Math.abs(touchLocation.x - this.lastTouchLocation_.x);
|
| + var yDiff = Math.abs(touchLocation.y - this.lastTouchLocation_.y);
|
| + if (xDiff <= IGNORABLE_TOUCH_MOVE_PX &&
|
| + yDiff <= IGNORABLE_TOUCH_MOVE_PX) {
|
| return true;
|
| }
|
|
|
| @@ -356,22 +356,22 @@ cr.define('options', function() {
|
| height: baseDiv.offsetHeight
|
| };
|
| switch (getPositionToRectangle(baseBounds, newCenter)) {
|
| - case SecondaryDisplayLayout.RIGHT:
|
| - this.layout_ = this.dragging_.display.isPrimary ?
|
| - SecondaryDisplayLayout.LEFT : SecondaryDisplayLayout.RIGHT;
|
| - break;
|
| - case SecondaryDisplayLayout.LEFT:
|
| - this.layout_ = this.dragging_.display.isPrimary ?
|
| - SecondaryDisplayLayout.RIGHT : SecondaryDisplayLayout.LEFT;
|
| - break;
|
| - case SecondaryDisplayLayout.TOP:
|
| - this.layout_ = this.dragging_.display.isPrimary ?
|
| - SecondaryDisplayLayout.BOTTOM : SecondaryDisplayLayout.TOP;
|
| - break;
|
| - case SecondaryDisplayLayout.BOTTOM:
|
| - this.layout_ = this.dragging_.display.isPrimary ?
|
| - SecondaryDisplayLayout.TOP : SecondaryDisplayLayout.BOTTOM;
|
| - break;
|
| + case SecondaryDisplayLayout.RIGHT:
|
| + this.layout_ = this.dragging_.display.isPrimary ?
|
| + SecondaryDisplayLayout.LEFT : SecondaryDisplayLayout.RIGHT;
|
| + break;
|
| + case SecondaryDisplayLayout.LEFT:
|
| + this.layout_ = this.dragging_.display.isPrimary ?
|
| + SecondaryDisplayLayout.RIGHT : SecondaryDisplayLayout.LEFT;
|
| + break;
|
| + case SecondaryDisplayLayout.TOP:
|
| + this.layout_ = this.dragging_.display.isPrimary ?
|
| + SecondaryDisplayLayout.BOTTOM : SecondaryDisplayLayout.TOP;
|
| + break;
|
| + case SecondaryDisplayLayout.BOTTOM:
|
| + this.layout_ = this.dragging_.display.isPrimary ?
|
| + SecondaryDisplayLayout.TOP : SecondaryDisplayLayout.BOTTOM;
|
| + break;
|
| }
|
|
|
| if (this.layout_ == SecondaryDisplayLayout.LEFT ||
|
| @@ -393,47 +393,47 @@ cr.define('options', function() {
|
| SecondaryDisplayLayout.RIGHT : SecondaryDisplayLayout.LEFT;
|
| }
|
|
|
| - var layout_to_base;
|
| + var layoutToBase;
|
| if (!this.dragging_.display.isPrimary) {
|
| - layout_to_base = this.layout_;
|
| + layoutToBase = this.layout_;
|
| } else {
|
| switch (this.layout_) {
|
| + case SecondaryDisplayLayout.RIGHT:
|
| + layoutToBase = SecondaryDisplayLayout.LEFT;
|
| + break;
|
| + case SecondaryDisplayLayout.LEFT:
|
| + layoutToBase = SecondaryDisplayLayout.RIGHT;
|
| + break;
|
| + case SecondaryDisplayLayout.TOP:
|
| + layoutToBase = SecondaryDisplayLayout.BOTTOM;
|
| + break;
|
| + case SecondaryDisplayLayout.BOTTOM:
|
| + layoutToBase = SecondaryDisplayLayout.TOP;
|
| + break;
|
| + }
|
| + }
|
| +
|
| + switch (layoutToBase) {
|
| case SecondaryDisplayLayout.RIGHT:
|
| - layout_to_base = SecondaryDisplayLayout.LEFT;
|
| + draggingDiv.style.left =
|
| + baseDiv.offsetLeft + baseDiv.offsetWidth + 'px';
|
| + draggingDiv.style.top = newPosition.y + 'px';
|
| break;
|
| case SecondaryDisplayLayout.LEFT:
|
| - layout_to_base = SecondaryDisplayLayout.RIGHT;
|
| + draggingDiv.style.left =
|
| + baseDiv.offsetLeft - draggingDiv.offsetWidth + 'px';
|
| + draggingDiv.style.top = newPosition.y + 'px';
|
| break;
|
| case SecondaryDisplayLayout.TOP:
|
| - layout_to_base = SecondaryDisplayLayout.BOTTOM;
|
| + draggingDiv.style.top =
|
| + baseDiv.offsetTop - draggingDiv.offsetHeight + 'px';
|
| + draggingDiv.style.left = newPosition.x + 'px';
|
| break;
|
| case SecondaryDisplayLayout.BOTTOM:
|
| - layout_to_base = SecondaryDisplayLayout.TOP;
|
| + draggingDiv.style.top =
|
| + baseDiv.offsetTop + baseDiv.offsetHeight + 'px';
|
| + draggingDiv.style.left = newPosition.x + 'px';
|
| break;
|
| - }
|
| - }
|
| -
|
| - switch (layout_to_base) {
|
| - case SecondaryDisplayLayout.RIGHT:
|
| - draggingDiv.style.left =
|
| - baseDiv.offsetLeft + baseDiv.offsetWidth + 'px';
|
| - draggingDiv.style.top = newPosition.y + 'px';
|
| - break;
|
| - case SecondaryDisplayLayout.LEFT:
|
| - draggingDiv.style.left =
|
| - baseDiv.offsetLeft - draggingDiv.offsetWidth + 'px';
|
| - draggingDiv.style.top = newPosition.y + 'px';
|
| - break;
|
| - case SecondaryDisplayLayout.TOP:
|
| - draggingDiv.style.top =
|
| - baseDiv.offsetTop - draggingDiv.offsetHeight + 'px';
|
| - draggingDiv.style.left = newPosition.x + 'px';
|
| - break;
|
| - case SecondaryDisplayLayout.BOTTOM:
|
| - draggingDiv.style.top =
|
| - baseDiv.offsetTop + baseDiv.offsetHeight + 'px';
|
| - draggingDiv.style.left = newPosition.x + 'px';
|
| - break;
|
| }
|
|
|
| return false;
|
|
|