From 313e76d9fee1cd49a36a00a266fbd0c323b56c0e Mon Sep 17 00:00:00 2001 From: Nicola Rizzo Date: Wed, 3 Jul 2013 15:57:43 +0200 Subject: [PATCH 1/2] typos and global declarations removed --- ux/slidenavigation/View.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ux/slidenavigation/View.js b/ux/slidenavigation/View.js index e392470..d0c49f1 100644 --- a/ux/slidenavigation/View.js +++ b/ux/slidenavigation/View.js @@ -162,14 +162,14 @@ Ext.define('Ext.ux.slidenavigation.View', { containerSlideDelay: -1, /** - * @cfg {Integer} slideDuration Number of miliseconds to animate the sliding + * @cfg {Integer} slideDuration Number of milliseconds to animate the sliding * of the container when "flicked". By default the animation is disable on * Android. */ slideDuration: Ext.os.is('Android') ? 0 : 200, /** - * @cfg {Integer} selectSlideDuration Number of miliseconds to animate the sliding + * @cfg {Integer} selectSlideDuration Number of milliseconds to animate the sliding * of the container when list item is selected (if closeOnSelect = true). The default * value here of 300 gives a much nicer feel. By default the animation is disable on * Android. @@ -317,7 +317,7 @@ Ext.define('Ext.ux.slidenavigation.View', { if (shadowStyle) { if (!document.getElementById(id)) { - style = document.createElement('style'); + var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.x-slidenavigation-container.x-dragging, '+ '.x-slidenavigation-container.open { '+ @@ -488,7 +488,7 @@ Ext.define('Ext.ux.slidenavigation.View', { } if (slideSelector) { - node = e.target; + var node = e.target; while (node = node.parentNode) { if (node.classList && node.classList.contains(slideSelector)) { this.fireEvent('dragstart', this); @@ -508,7 +508,7 @@ Ext.define('Ext.ux.slidenavigation.View', { */ onContainerDragend: function(draggable, e, eOpts) { var velocity = Math.abs(e.deltaX / e.deltaTime), - listPosition = this.getListPosition() + listPosition = this.getListPosition(), direction = (e.deltaX > 0) ? "right" : "left", offset = Ext.clone(draggable.offset), threshold = parseInt(this.config.list.minWidth * .70); @@ -621,7 +621,7 @@ Ext.define('Ext.ux.slidenavigation.View', { */ moveContainer: function(nav, offsetX, duration) { var duration = duration || this.config.slideDuration, - draggable = this.container.draggableBehavior.draggable; + draggable = this.container.draggableBehavior.draggable, listPosition = this.getListPosition(); // Invert the direction of the side movement @@ -653,7 +653,7 @@ Ext.define('Ext.ux.slidenavigation.View', { * @return {Boolean} Whether or not the container is fully open. */ isOpened: function() { - var listPosition = this.getListPosition(); + var listPosition = this.getListPosition(), offset = (listPosition == "left") ? this.config.list.minWidth : -this.config.list.minWidth; return (this.container.draggableBehavior.draggable.offset.x == offset); @@ -800,7 +800,7 @@ Ext.define('Ext.ux.slidenavigation.View', { if (deltaY > 10 && !container.dragAllowed) { container.dragAllowedForced = true; return false; - }; + } // If vertical scroll-lock hasn't been enforced (``dragAllowedForced``), and // ``deltaX`` is large enough, enable horizontal dragging @@ -808,7 +808,7 @@ Ext.define('Ext.ux.slidenavigation.View', { if (!container.dragAllowed) { scrollParent = me.container.getActiveItem().down('component[scrollable]'); if (scrollParent) { - scrollable = scrollParent.getScrollable(); + var scrollable = scrollParent.getScrollable(), scroller = scrollable.getScroller(); scroller._scrollState = scroller.getDisabled(); @@ -830,7 +830,7 @@ Ext.define('Ext.ux.slidenavigation.View', { // Re-enable scrolling on the child element scrollParent = me.container.getActiveItem().down('component[scrollable]'); if (scrollParent) { - scrollable = scrollParent.getScrollable(); + var scrollable = scrollParent.getScrollable(), scroller = scrollable.getScroller(); scroller._scrollState = scroller.getDisabled(); From 847b9026273932b203a184f90738ddbd86dbf531 Mon Sep 17 00:00:00 2001 From: Nicola Rizzo Date: Wed, 3 Jul 2013 16:40:58 +0200 Subject: [PATCH 2/2] globals removed --- ux/slidenavigation/View.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ux/slidenavigation/View.js b/ux/slidenavigation/View.js index d0c49f1..ab710fa 100644 --- a/ux/slidenavigation/View.js +++ b/ux/slidenavigation/View.js @@ -344,7 +344,7 @@ Ext.define('Ext.ux.slidenavigation.View', { if (parent) { // Make sure that the button is placed on the correct side of the toolbar - layout = parent.getLayout(); + var layout = parent.getLayout(); if (layout && Ext.isFunction(layout.setPack)) { layout.setPack(listPosition); } @@ -792,7 +792,7 @@ Ext.define('Ext.ux.slidenavigation.View', { if (containerSlideDelay > -1) { container.element.on({ drag: function(e, node, opts, eOpts) { - deltaX = e.absDeltaX; + var deltaX = e.absDeltaX, deltaY = e.absDeltaY; // This essentally acts as a vertical 'scroll-lock'. If the user drags more @@ -806,7 +806,7 @@ Ext.define('Ext.ux.slidenavigation.View', { // ``deltaX`` is large enough, enable horizontal dragging if (deltaX > containerSlideDelay && !container.dragAllowed && !container.dragAllowedForced) { if (!container.dragAllowed) { - scrollParent = me.container.getActiveItem().down('component[scrollable]'); + var scrollParent = me.container.getActiveItem().down('component[scrollable]'); if (scrollParent) { var scrollable = scrollParent.getScrollable(), scroller = scrollable.getScroller(); @@ -828,7 +828,7 @@ Ext.define('Ext.ux.slidenavigation.View', { dragend: function() { if (container.dragAllowed) { // Re-enable scrolling on the child element - scrollParent = me.container.getActiveItem().down('component[scrollable]'); + var scrollParent = me.container.getActiveItem().down('component[scrollable]'); if (scrollParent) { var scrollable = scrollParent.getScrollable(), scroller = scrollable.getScroller();