Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: chrome/browser/resources/options/chromeos/display_options.js

Issue 12560002: Change var blah_blah -> blahBlah. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.js ('k') | chrome/browser/resources/options/chromeos/internet_detail.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698