| Index: ui/webui/resources/js/cr/ui/splitter.js
|
| diff --git a/ui/webui/resources/js/cr/ui/splitter.js b/ui/webui/resources/js/cr/ui/splitter.js
|
| index c457e421e9e60265dbcdf7bc14f44aae102d0b24..b2c601a5e9ca7fab0151bb94fd2f691c54d1b316 100644
|
| --- a/ui/webui/resources/js/cr/ui/splitter.js
|
| +++ b/ui/webui/resources/js/cr/ui/splitter.js
|
| @@ -42,8 +42,8 @@ cr.define('cr.ui', function() {
|
| */
|
| function getZoomFactor(doc) {
|
| var dummyElement = doc.createElement('div');
|
| - dummyElement.style.cssText =
|
| - 'position:absolute;width:100px;height:100px;top:-1000px;overflow:hidden';
|
| + dummyElement.style.cssText = 'position:absolute;width:100px;height:100px;' +
|
| + 'top:-1000px;overflow:hidden';
|
| doc.body.appendChild(dummyElement);
|
| var cs = doc.defaultView.getComputedStyle(dummyElement);
|
| var rect = dummyElement.getBoundingClientRect();
|
| @@ -67,10 +67,10 @@ cr.define('cr.ui', function() {
|
| * Initializes the element.
|
| */
|
| decorate: function() {
|
| - this.addEventListener('mousedown', this.handleMouseDown_.bind(this),
|
| - true);
|
| - this.addEventListener('touchstart', this.handleTouchStart_.bind(this),
|
| - true);
|
| + this.addEventListener(
|
| + 'mousedown', this.handleMouseDown_.bind(this), true);
|
| + this.addEventListener(
|
| + 'touchstart', this.handleTouchStart_.bind(this), true);
|
| this.resizeNextElement_ = false;
|
| },
|
|
|
| @@ -78,9 +78,7 @@ cr.define('cr.ui', function() {
|
| * @param {boolean} resizeNext True if resize the next element.
|
| * By default, splitter resizes previous (left) element.
|
| */
|
| - set resizeNextElement(resizeNext) {
|
| - this.resizeNextElement_ = resizeNext;
|
| - },
|
| + set resizeNextElement(resizeNext) { this.resizeNextElement_ = resizeNext; },
|
|
|
| /**
|
| * Starts the dragging of the splitter. Adds listeners for mouse or touch
|
| @@ -162,7 +160,7 @@ cr.define('cr.ui', function() {
|
| * @private
|
| */
|
| handleMouseDown_: function(e) {
|
| - e = /** @type {!MouseEvent} */(e);
|
| + e = /** @type {!MouseEvent} */ (e);
|
| if (e.button)
|
| return;
|
| this.startDrag(e.clientX, false);
|
| @@ -176,7 +174,7 @@ cr.define('cr.ui', function() {
|
| * @private
|
| */
|
| handleTouchStart_: function(e) {
|
| - e = /** @type {!TouchEvent} */(e);
|
| + e = /** @type {!TouchEvent} */ (e);
|
| if (e.touches.length == 1) {
|
| this.startDrag(e.touches[0].clientX, true);
|
| e.preventDefault();
|
| @@ -189,9 +187,7 @@ cr.define('cr.ui', function() {
|
| * @param {!MouseEvent} e The mouse event.
|
| * @private
|
| */
|
| - handleMouseMove_: function(e) {
|
| - this.handleMove_(e.clientX);
|
| - },
|
| + handleMouseMove_: function(e) { this.handleMove_(e.clientX); },
|
|
|
| /**
|
| * Handles the touch move event.
|
| @@ -209,8 +205,9 @@ cr.define('cr.ui', function() {
|
| * @private
|
| */
|
| handleMove_: function(clientX) {
|
| - var rtl = this.ownerDocument.defaultView.getComputedStyle(this).
|
| - direction == 'rtl';
|
| + var rtl =
|
| + this.ownerDocument.defaultView.getComputedStyle(this).direction ==
|
| + 'rtl';
|
| var dirMultiplier = rtl ? -1 : 1;
|
| var deltaX = dirMultiplier * (clientX - this.startX_);
|
| this.handleSplitterDragMove(deltaX);
|
| @@ -221,9 +218,7 @@ cr.define('cr.ui', function() {
|
| * @param {!MouseEvent} e The mouse event.
|
| * @private
|
| */
|
| - handleMouseUp_: function(e) {
|
| - this.endDrag_();
|
| - },
|
| + handleMouseUp_: function(e) { this.endDrag_(); },
|
|
|
| /**
|
| * Handles start of the splitter dragging. Saves current width of the
|
| @@ -235,8 +230,8 @@ cr.define('cr.ui', function() {
|
| // box sizing the element has.
|
| var targetElement = this.getResizeTarget_();
|
| var doc = targetElement.ownerDocument;
|
| - this.startWidth_ = parseFloat(
|
| - doc.defaultView.getComputedStyle(targetElement).width);
|
| + this.startWidth_ =
|
| + parseFloat(doc.defaultView.getComputedStyle(targetElement).width);
|
| },
|
|
|
| /**
|
| @@ -259,14 +254,12 @@ cr.define('cr.ui', function() {
|
| // Check if the size changed.
|
| var targetElement = this.getResizeTarget_();
|
| var doc = targetElement.ownerDocument;
|
| - var computedWidth = parseFloat(
|
| - doc.defaultView.getComputedStyle(targetElement).width);
|
| + var computedWidth =
|
| + parseFloat(doc.defaultView.getComputedStyle(targetElement).width);
|
| if (this.startWidth_ != computedWidth)
|
| cr.dispatchSimpleEvent(this, 'resize');
|
| },
|
| };
|
|
|
| - return {
|
| - Splitter: Splitter
|
| - };
|
| + return {Splitter: Splitter};
|
| });
|
|
|