Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

globals #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions ux/slidenavigation/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 { '+
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -792,23 +792,23 @@ 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
// than 10px vertically, we disable horizontal drag all together.
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
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) {
scrollable = scrollParent.getScrollable();
var scrollable = scrollParent.getScrollable(),
scroller = scrollable.getScroller();
scroller._scrollState = scroller.getDisabled();

Expand All @@ -828,9 +828,9 @@ 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) {
scrollable = scrollParent.getScrollable();
var scrollable = scrollParent.getScrollable(),
scroller = scrollable.getScroller();
scroller._scrollState = scroller.getDisabled();

Expand Down