added ability to deactivate noClickDelay
added ability to deactivate noClickDelay (e.g.: if it isn't needed)
This commit is contained in:
parent
681925845f
commit
ba82104912
|
@ -17,7 +17,8 @@ var SplitViewNavigator = function( target, options ) {
|
||||||
CSSNamespace: 'splitViewNavigator_',
|
CSSNamespace: 'splitViewNavigator_',
|
||||||
toggleButtonLabel: 'Menu',
|
toggleButtonLabel: 'Menu',
|
||||||
backLinkCSS: 'viewNavigator_backButton',
|
backLinkCSS: 'viewNavigator_backButton',
|
||||||
bindToWindow: true
|
bindToWindow: true,
|
||||||
|
useNoClickDelay: true
|
||||||
};
|
};
|
||||||
|
|
||||||
this.options = options = $.extend( {}, defaults, options );
|
this.options = options = $.extend( {}, defaults, options );
|
||||||
|
@ -72,8 +73,10 @@ var SplitViewNavigator = function( target, options ) {
|
||||||
|
|
||||||
this.contentOverlay.click( function(event){ self.hideSidebar() } );
|
this.contentOverlay.click( function(event){ self.hideSidebar() } );
|
||||||
|
|
||||||
new NoClickDelay( this.contentOverlay.get()[0] );
|
if ( this.options.useNoClickDelay ) {
|
||||||
new NoClickDelay( this.toggleSidebarButton.get()[0] );
|
new NoClickDelay( this.contentOverlay.get()[0] );
|
||||||
|
new NoClickDelay( this.toggleSidebarButton.get()[0] );
|
||||||
|
}
|
||||||
window.splitViewNavigator = this;
|
window.splitViewNavigator = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,8 @@ var ViewNavigator = function( target, options ) {
|
||||||
var defaults = {
|
var defaults = {
|
||||||
CSSNamespace: 'viewNavigator_',
|
CSSNamespace: 'viewNavigator_',
|
||||||
backLinkCSS: 'viewNavigator_backButton',
|
backLinkCSS: 'viewNavigator_backButton',
|
||||||
bindToWindow: true
|
bindToWindow: true,
|
||||||
|
useNoClickDelay: true
|
||||||
};
|
};
|
||||||
|
|
||||||
this.options = options = $.extend( {}, defaults, options );
|
this.options = options = $.extend( {}, defaults, options );
|
||||||
|
@ -268,7 +269,7 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
|
||||||
this.resetScroller();
|
this.resetScroller();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( viewDescriptor.backLabel ) {
|
if ( viewDescriptor.backLabel && this.options.useNoClickDelay ) {
|
||||||
new NoClickDelay( this.headerBacklink.get()[0] );
|
new NoClickDelay( this.headerBacklink.get()[0] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +328,7 @@ ViewNavigator.prototype.resetScroller = function() {
|
||||||
self.scroller.scrollTo( 0, parseInt( scrollY, 10 ) );
|
self.scroller.scrollTo( 0, parseInt( scrollY, 10 ) );
|
||||||
}
|
}
|
||||||
}, 10 );
|
}, 10 );
|
||||||
//this.scroller = new iScroll( id );
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var target = $('#'+id );
|
var target = $('#'+id );
|
||||||
|
|
Loading…
Reference in New Issue