added ability to deactivate noClickDelay

added ability to deactivate noClickDelay (e.g.: if it isn't needed)
This commit is contained in:
Andre Meyering 2013-01-23 15:47:56 +01:00
parent 681925845f
commit ba82104912
2 changed files with 10 additions and 6 deletions

View File

@ -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;
} }

View File

@ -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 );