Changed default quotation marks
Changed from double (") to single (') quotation marks
This commit is contained in:
parent
6a767743bd
commit
214f9cd9b6
|
@ -21,18 +21,18 @@ var SlidingView = function( sidebarId, bodyId ) {
|
||||||
|
|
||||||
this.sidebarWidth = 250;
|
this.sidebarWidth = 250;
|
||||||
|
|
||||||
this.sidebar = $("#"+sidebarId);
|
this.sidebar = $('#'+sidebarId);
|
||||||
this.body = $("#"+bodyId);
|
this.body = $('#'+bodyId);
|
||||||
|
|
||||||
this.sidebar.addClass( "slidingview_sidebar" );
|
this.sidebar.addClass( 'slidingview_sidebar' );
|
||||||
this.body.addClass( "slidingview_body" );
|
this.body.addClass( 'slidingview_body' );
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
$(window).resize( function(event){ self.resizeContent() } );
|
$(window).resize( function(event){ self.resizeContent() } );
|
||||||
$(this.parent).resize( function(event){ self.resizeContent() } );
|
$(this.parent).resize( function(event){ self.resizeContent() } );
|
||||||
|
|
||||||
if ( "onorientationchange" in window ) {
|
if ( 'onorientationchange' in window ) {
|
||||||
$(window).bind( "onorientationchange", function(event){ self.resizeContent() } )
|
$(window).bind( 'onorientationchange', function(event){ self.resizeContent() } )
|
||||||
}
|
}
|
||||||
this.resizeContent();
|
this.resizeContent();
|
||||||
this.setupEventHandlers();
|
this.setupEventHandlers();
|
||||||
|
@ -117,17 +117,17 @@ SlidingView.prototype.updateBasedOnTouchPoints = function( currentPosition ) {
|
||||||
this.bodyOffset = targetX;
|
this.bodyOffset = targetX;
|
||||||
|
|
||||||
//console.log( targetX );
|
//console.log( targetX );
|
||||||
//this.body.css("left", targetX );
|
//this.body.css('left', targetX );
|
||||||
//console.log( this.body.css("left") );
|
//console.log( this.body.css('left') );
|
||||||
|
|
||||||
if ( this.body.css("left") != "0px" ) {
|
if ( this.body.css('left') != '0px' ) {
|
||||||
this.body.css("left", "0px" );
|
this.body.css('left', '0px' );
|
||||||
}
|
}
|
||||||
this.body.css("-webkit-transform", "translate3d(" + targetX + "px,0,0)" );
|
this.body.css('-webkit-transform', 'translate3d(' + targetX + 'px,0,0)' );
|
||||||
this.body.css("-moz-transform", "translate3d(" + targetX + "px,0,0)" );
|
this.body.css('-moz-transform', 'translate3d(' + targetX + 'px,0,0)' );
|
||||||
this.body.css("transform", "translate3d(" + targetX + "px,0,0)" );
|
this.body.css('transform', 'translate3d(' + targetX + 'px,0,0)' );
|
||||||
|
|
||||||
//console.log( this.body.css("-moz-transform"), targetX );
|
//console.log( this.body.css('-moz-transform'), targetX );
|
||||||
|
|
||||||
|
|
||||||
/*if ( currentPosition != targetX ) {
|
/*if ( currentPosition != targetX ) {
|
||||||
|
@ -139,15 +139,15 @@ SlidingView.prototype.updateBasedOnTouchPoints = function( currentPosition ) {
|
||||||
}, 100);
|
}, 100);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
this.sidebar.trigger( "slidingViewProgress", { current: targetX, max:this.sidebarWidth } );
|
this.sidebar.trigger( 'slidingViewProgress', { current: targetX, max:this.sidebarWidth } );
|
||||||
|
|
||||||
this.gestureStartPosition = currentPosition;
|
this.gestureStartPosition = currentPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
SlidingView.prototype.snapToPosition = function() {
|
SlidingView.prototype.snapToPosition = function() {
|
||||||
|
|
||||||
//this.body.css("-webkit-transform", "translate3d(0,0,0)" );
|
//this.body.css('-webkit-transform', 'translate3d(0,0,0)' );
|
||||||
this.body.css("left", "0px" );
|
this.body.css('left', '0px' );
|
||||||
var currentPosition = this.bodyOffset;
|
var currentPosition = this.bodyOffset;
|
||||||
var halfWidth = this.sidebarWidth / 2;
|
var halfWidth = this.sidebarWidth / 2;
|
||||||
var targetX;
|
var targetX;
|
||||||
|
@ -169,7 +169,7 @@ SlidingView.prototype.snapToPosition = function() {
|
||||||
useTranslate3d: true
|
useTranslate3d: true
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
this.sidebar.trigger( "slidingViewProgress", { current:targetX, max:this.sidebarWidth } );
|
this.sidebar.trigger( 'slidingViewProgress', { current:targetX, max:this.sidebarWidth } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ var SplitViewNavigator = function( target, toggleButtonLabel, backLinkCSS, bindT
|
||||||
this.uniqueId = this.guid();
|
this.uniqueId = this.guid();
|
||||||
this.parent = $( target );
|
this.parent = $( target );
|
||||||
|
|
||||||
var regexp = new RegExp("Windows Phone OS 7");
|
var regexp = new RegExp('Windows Phone OS 7');
|
||||||
this.winPhone = (navigator.userAgent.search(regexp) >= 0);
|
this.winPhone = (navigator.userAgent.search(regexp) >= 0);
|
||||||
|
|
||||||
this.rootElement = $('<div class="splitViewNavigator_root"></div>');
|
this.rootElement = $('<div class="splitViewNavigator_root"></div>');
|
||||||
|
@ -32,7 +32,7 @@ var SplitViewNavigator = function( target, toggleButtonLabel, backLinkCSS, bindT
|
||||||
|
|
||||||
this.bodyViewNavigator = new ViewNavigator( this.bodyContainer.get()[0], backLinkCSS, false );
|
this.bodyViewNavigator = new ViewNavigator( this.bodyContainer.get()[0], backLinkCSS, false );
|
||||||
|
|
||||||
this.backLinkCSS = backLinkCSS ? backLinkCSS : "viewNavigator_backButton";
|
this.backLinkCSS = backLinkCSS ? backLinkCSS : 'viewNavigator_backButton';
|
||||||
|
|
||||||
this.toggleSidebarButton = $('<li class="viewNavigator_backButton viewNavigator_backButtonPosition ' + backLinkCSS + '" id="toggle' + this.uniqueId + '" onclick="window.splitViewNavigator.showSidebar()">'+toggleButtonLabel+'</li>');
|
this.toggleSidebarButton = $('<li class="viewNavigator_backButton viewNavigator_backButtonPosition ' + backLinkCSS + '" id="toggle' + this.uniqueId + '" onclick="window.splitViewNavigator.showSidebar()">'+toggleButtonLabel+'</li>');
|
||||||
|
|
||||||
|
@ -43,12 +43,12 @@ var SplitViewNavigator = function( target, toggleButtonLabel, backLinkCSS, bindT
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
/*if ( "onorientationchange" in window ) {
|
/*if ( 'onorientationchange' in window ) {
|
||||||
$(window).bind( "orientationchange", function(event){ self.resizeContent() } )
|
$(window).bind( 'orientationchange', function(event){ self.resizeContent() } )
|
||||||
}
|
}
|
||||||
else {*/
|
else {*/
|
||||||
//$(window).resize( function(event){ self.resizeContent() } );
|
//$(window).resize( function(event){ self.resizeContent() } );
|
||||||
//alert( this.parent.attr( "id" ) );
|
//alert( this.parent.attr( 'id' ) );
|
||||||
this.parent.resize( function(event){ self.resizeContent() } );
|
this.parent.resize( function(event){ self.resizeContent() } );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
@ -84,29 +84,29 @@ SplitViewNavigator.prototype.applyStylesByOrientation = function() {
|
||||||
var h = $window.height();
|
var h = $window.height();
|
||||||
|
|
||||||
|
|
||||||
var orientation = (w >= h) ? "landscape" : "portrait";
|
var orientation = (w >= h) ? 'landscape' : 'portrait';
|
||||||
this.contentOverlay.removeClass( "content_overlay_visible" ).addClass( "content_overlay_hidden" );
|
this.contentOverlay.removeClass( 'content_overlay_visible' ).addClass( 'content_overlay_hidden' );
|
||||||
|
|
||||||
//landscape
|
//landscape
|
||||||
if ( orientation == "landscape" && this.orientation != orientation ) {
|
if ( orientation == 'landscape' && this.orientation != orientation ) {
|
||||||
this.sidebarContainer.removeClass( "sidebar_portrait" ).addClass( "sidebar_landscape" );
|
this.sidebarContainer.removeClass( 'sidebar_portrait' ).addClass( 'sidebar_landscape' );
|
||||||
this.bodyViewNavigator.setHeaderPadding( 0 );
|
this.bodyViewNavigator.setHeaderPadding( 0 );
|
||||||
this.toggleSidebarButton.remove();
|
this.toggleSidebarButton.remove();
|
||||||
if ( this.animationPerformed ) {
|
if ( this.animationPerformed ) {
|
||||||
this.sidebarContainer.css( "left", 0 );
|
this.sidebarContainer.css( 'left', 0 );
|
||||||
}
|
}
|
||||||
this.bodyContainer.removeClass( "body_portrait" ).addClass( "body_landscape" );
|
this.bodyContainer.removeClass( 'body_portrait' ).addClass( 'body_landscape' );
|
||||||
}
|
}
|
||||||
|
|
||||||
//portrait
|
//portrait
|
||||||
else if ( this.orientation != orientation ) {
|
else if ( this.orientation != orientation ) {
|
||||||
this.sidebarContainer.removeClass( "sidebar_landscape" ).addClass( "sidebar_portrait" );
|
this.sidebarContainer.removeClass( 'sidebar_landscape' ).addClass( 'sidebar_portrait' );
|
||||||
this.bodyViewNavigator.setHeaderPadding( "70px" );
|
this.bodyViewNavigator.setHeaderPadding( '70px' );
|
||||||
this.bodyContainer.append( this.toggleSidebarButton );
|
this.bodyContainer.append( this.toggleSidebarButton );
|
||||||
if ( this.animationPerformed ) {
|
if ( this.animationPerformed ) {
|
||||||
this.sidebarContainer.css( "left", -this.sidebarContainer.width() );
|
this.sidebarContainer.css( 'left', -this.sidebarContainer.width() );
|
||||||
}
|
}
|
||||||
this.bodyContainer.removeClass( "body_landscape" ).addClass( "body_portrait" );
|
this.bodyContainer.removeClass( 'body_landscape' ).addClass( 'body_portrait' );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.orientation = orientation;
|
this.orientation = orientation;
|
||||||
|
@ -114,8 +114,8 @@ SplitViewNavigator.prototype.applyStylesByOrientation = function() {
|
||||||
|
|
||||||
SplitViewNavigator.prototype.showSidebar = function() {
|
SplitViewNavigator.prototype.showSidebar = function() {
|
||||||
this.animationPerformed = true;
|
this.animationPerformed = true;
|
||||||
if ( this.orientation == "portrait" ) {
|
if ( this.orientation == 'portrait' ) {
|
||||||
this.contentOverlay.removeClass( "content_overlay_hidden" ).addClass( "content_overlay_visible" );
|
this.contentOverlay.removeClass( 'content_overlay_hidden' ).addClass( 'content_overlay_visible' );
|
||||||
this.animating = true;
|
this.animating = true;
|
||||||
this.sidebarContainer.animate({
|
this.sidebarContainer.animate({
|
||||||
left:0,
|
left:0,
|
||||||
|
@ -127,8 +127,8 @@ SplitViewNavigator.prototype.showSidebar = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SplitViewNavigator.prototype.hideSidebar = function() {
|
SplitViewNavigator.prototype.hideSidebar = function() {
|
||||||
if ( this.orientation == "portrait" ) {
|
if ( this.orientation == 'portrait' ) {
|
||||||
this.contentOverlay.removeClass( "content_overlay_visible" ).addClass( "content_overlay_hidden" );
|
this.contentOverlay.removeClass( 'content_overlay_visible' ).addClass( 'content_overlay_hidden' );
|
||||||
this.animating = true;
|
this.animating = true;
|
||||||
this.sidebarContainer.animate({
|
this.sidebarContainer.animate({
|
||||||
left:-this.sidebarContainer.width(),
|
left:-this.sidebarContainer.width(),
|
||||||
|
@ -181,5 +181,5 @@ SplitViewNavigator.prototype.S4 = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SplitViewNavigator.prototype.guid = function() {
|
SplitViewNavigator.prototype.guid = function() {
|
||||||
return (this.S4() + this.S4() + "-" + this.S4() + "-4" + this.S4().substr(0,3) + "-" + this.S4() + "-" + this.S4() + this.S4() + this.S4()).toLowerCase();
|
return (this.S4() + this.S4() + '-' + this.S4() + '-4' + this.S4().substr(0,3) + '-' + this.S4() + '-' + this.S4() + this.S4() + this.S4()).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ var ViewNavigator = function( target, backLinkCSS, bindToWindow ) {
|
||||||
|
|
||||||
this.uniqueId = this.guid();
|
this.uniqueId = this.guid();
|
||||||
|
|
||||||
var regexp = new RegExp("Windows Phone OS 7");
|
var regexp = new RegExp('Windows Phone OS 7');
|
||||||
this.winPhone = (navigator.userAgent.search(regexp) >= 0);
|
this.winPhone = (navigator.userAgent.search(regexp) >= 0);
|
||||||
|
|
||||||
this.rootElement = $('<div class="viewNavigator_root"></div>');
|
this.rootElement = $('<div class="viewNavigator_root"></div>');
|
||||||
|
@ -34,7 +34,7 @@ var ViewNavigator = function( target, backLinkCSS, bindToWindow ) {
|
||||||
|
|
||||||
this.parent = $( target );
|
this.parent = $( target );
|
||||||
|
|
||||||
this.backLinkCSS = backLinkCSS ? backLinkCSS : "viewNavigator_backButton";
|
this.backLinkCSS = backLinkCSS ? backLinkCSS : 'viewNavigator_backButton';
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
//$(window).resize( function(event){ self.resizeContent() } );
|
//$(window).resize( function(event){ self.resizeContent() } );
|
||||||
|
@ -60,9 +60,9 @@ var ViewNavigator = function( target, backLinkCSS, bindToWindow ) {
|
||||||
ViewNavigator.prototype.replaceView = function( viewDescriptor ) {
|
ViewNavigator.prototype.replaceView = function( viewDescriptor ) {
|
||||||
if (this.animating)
|
if (this.animating)
|
||||||
return;
|
return;
|
||||||
viewDescriptor.animation = "pushEffect"
|
viewDescriptor.animation = 'pushEffect'
|
||||||
|
|
||||||
//this is a hack to mimic behavior of pushView, then pop off the "current" from the history
|
//this is a hack to mimic behavior of pushView, then pop off the 'current' from the history
|
||||||
this.history.push( viewDescriptor );
|
this.history.push( viewDescriptor );
|
||||||
this.updateView( viewDescriptor );
|
this.updateView( viewDescriptor );
|
||||||
this.history.pop();
|
this.history.pop();
|
||||||
|
@ -73,7 +73,7 @@ ViewNavigator.prototype.replaceView = function( viewDescriptor ) {
|
||||||
ViewNavigator.prototype.pushView = function( viewDescriptor ) {
|
ViewNavigator.prototype.pushView = function( viewDescriptor ) {
|
||||||
if (this.animating)
|
if (this.animating)
|
||||||
return;
|
return;
|
||||||
viewDescriptor.animation = "pushEffect"
|
viewDescriptor.animation = 'pushEffect'
|
||||||
this.history.push( viewDescriptor );
|
this.history.push( viewDescriptor );
|
||||||
this.updateView( viewDescriptor );
|
this.updateView( viewDescriptor );
|
||||||
}
|
}
|
||||||
|
@ -90,14 +90,14 @@ ViewNavigator.prototype.popView = function() {
|
||||||
|
|
||||||
this.history.pop();
|
this.history.pop();
|
||||||
var viewDescriptor = this.history[ this.history.length-1 ];
|
var viewDescriptor = this.history[ this.history.length-1 ];
|
||||||
viewDescriptor.animation = "popEffect"
|
viewDescriptor.animation = 'popEffect'
|
||||||
this.updateView( viewDescriptor );
|
this.updateView( viewDescriptor );
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewNavigator.prototype.setHeaderPadding = function( amount ) {
|
ViewNavigator.prototype.setHeaderPadding = function( amount ) {
|
||||||
this.headerPadding = amount;
|
this.headerPadding = amount;
|
||||||
if ( this.headerBacklink ) {
|
if ( this.headerBacklink ) {
|
||||||
this.headerBacklink.css("left", amount);
|
this.headerBacklink.css('left', amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
|
||||||
|
|
||||||
this.headerContent = $('<div class="viewNavigator_headerContent"></div>');
|
this.headerContent = $('<div class="viewNavigator_headerContent"></div>');
|
||||||
|
|
||||||
this.headerTitle = $("<div class='viewNavigator_header_title'>" + viewDescriptor.title + "</div>");
|
this.headerTitle = $('<div class="viewNavigator_header_title">' + viewDescriptor.title + '</div>');
|
||||||
this.headerContent.append( this.headerTitle );
|
this.headerContent.append( this.headerTitle );
|
||||||
|
|
||||||
var linkGuid = this.guid();
|
var linkGuid = this.guid();
|
||||||
|
@ -151,28 +151,28 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
|
||||||
|
|
||||||
//use this to mantain scroll position when scroller is destroyed
|
//use this to mantain scroll position when scroller is destroyed
|
||||||
var children = $( this.contentPendingRemove.children()[0] );
|
var children = $( this.contentPendingRemove.children()[0] );
|
||||||
children.attr( "scrollY", scrollY );
|
children.attr( 'scrollY', scrollY );
|
||||||
var originalTopMargin = children.css( "margin-top" );
|
var originalTopMargin = children.css( 'margin-top' );
|
||||||
children.attr( "originalTopMargin", originalTopMargin );
|
children.attr( 'originalTopMargin', originalTopMargin );
|
||||||
|
|
||||||
var cssString = "translate3d(0px, "+(parseInt( scrollY ) + parseInt( originalTopMargin )).toString()+"px, 0px)";
|
var cssString = 'translate3d(0px, '+(parseInt( scrollY ) + parseInt( originalTopMargin )).toString()+'px, 0px)';
|
||||||
children.css( "-webkit-transform", cssString );
|
children.css( '-webkit-transform', cssString );
|
||||||
|
|
||||||
// children.css( "margin-top", (parseInt( scrollY ) + parseInt( originalTopMargin )).toString() + "px" );
|
// children.css( 'margin-top', (parseInt( scrollY ) + parseInt( originalTopMargin )).toString() + 'px' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this.contentPendingRemove).click(function(){ return false; });
|
$(this.contentPendingRemove).click(function(){ return false; });
|
||||||
|
|
||||||
|
|
||||||
if ( viewDescriptor.animation == "popEffect" ) {
|
if ( viewDescriptor.animation == 'popEffect' ) {
|
||||||
|
|
||||||
this.contentViewHolder.css( "left", -this.contentViewHolder.width() );
|
this.contentViewHolder.css( 'left', -this.contentViewHolder.width() );
|
||||||
this.contentViewHolder.css( "opacity", 1 );
|
this.contentViewHolder.css( 'opacity', 1 );
|
||||||
this.content.prepend( this.contentViewHolder );
|
this.content.prepend( this.contentViewHolder );
|
||||||
|
|
||||||
this.headerContent.css( "left", -this.animationX );
|
this.headerContent.css( 'left', -this.animationX );
|
||||||
this.headerContent.css( "opacity", 0 );
|
this.headerContent.css( 'opacity', 0 );
|
||||||
this.header.append( this.headerContent );
|
this.header.append( this.headerContent );
|
||||||
|
|
||||||
var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
|
var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
|
||||||
|
@ -211,13 +211,13 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
|
||||||
}
|
}
|
||||||
else if ( this.history.length > 1 ) {
|
else if ( this.history.length > 1 ) {
|
||||||
|
|
||||||
this.contentViewHolder.css( "left", this.contentViewHolder.width() );
|
this.contentViewHolder.css( 'left', this.contentViewHolder.width() );
|
||||||
this.contentViewHolder.css( "opacity", 1 );
|
this.contentViewHolder.css( 'opacity', 1 );
|
||||||
|
|
||||||
this.content.append( this.contentViewHolder );
|
this.content.append( this.contentViewHolder );
|
||||||
|
|
||||||
this.headerContent.css( "left", this.animationX );
|
this.headerContent.css( 'left', this.animationX );
|
||||||
this.headerContent.css( "opacity", 0 );
|
this.headerContent.css( 'opacity', 0 );
|
||||||
this.header.append( this.headerContent );
|
this.header.append( this.headerContent );
|
||||||
|
|
||||||
var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
|
var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
|
||||||
|
@ -253,12 +253,12 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
|
||||||
//setTimeout( func, this.animationDuration+90 );
|
//setTimeout( func, this.animationDuration+90 );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.contentViewHolder.css( "left", 0 );
|
this.contentViewHolder.css( 'left', 0 );
|
||||||
this.contentViewHolder.css( "opacity", 1 );
|
this.contentViewHolder.css( 'opacity', 1 );
|
||||||
this.content.append( this.contentViewHolder );
|
this.content.append( this.contentViewHolder );
|
||||||
|
|
||||||
this.headerContent.css( "left", 0 );
|
this.headerContent.css( 'left', 0 );
|
||||||
this.headerContent.css( "opacity", 1 );
|
this.headerContent.css( 'opacity', 1 );
|
||||||
this.header.append( this.headerContent );
|
this.header.append( this.headerContent );
|
||||||
this.animating = false;
|
this.animating = false;
|
||||||
this.resetScroller();
|
this.resetScroller();
|
||||||
|
@ -287,7 +287,7 @@ ViewNavigator.prototype.destroyScroller = function() {
|
||||||
|
|
||||||
ViewNavigator.prototype.resetScroller = function() {
|
ViewNavigator.prototype.resetScroller = function() {
|
||||||
|
|
||||||
var id = this.contentViewHolder.attr( "id" );
|
var id = this.contentViewHolder.attr( 'id' );
|
||||||
var currentViewDescriptor = this.history[ this.history.length-1];
|
var currentViewDescriptor = this.history[ this.history.length-1];
|
||||||
this.destroyScroller();
|
this.destroyScroller();
|
||||||
|
|
||||||
|
@ -298,25 +298,25 @@ ViewNavigator.prototype.resetScroller = function() {
|
||||||
setTimeout( function() {
|
setTimeout( function() {
|
||||||
|
|
||||||
//use this to mantain scroll position when scroller is destroyed
|
//use this to mantain scroll position when scroller is destroyed
|
||||||
var targetDiv = $( $("#"+id ).children()[0] );
|
var targetDiv = $( $('#'+id ).children()[0] );
|
||||||
var scrollY= targetDiv.attr( "scrollY" );
|
var scrollY= targetDiv.attr( 'scrollY' );
|
||||||
var originalTopMargin = targetDiv.attr( "originalTopMargin" );
|
var originalTopMargin = targetDiv.attr( 'originalTopMargin' );
|
||||||
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != "" ){
|
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != '' ){
|
||||||
// console.log( "resetScroller scrollY: " + scrollY)
|
// console.log( 'resetScroller scrollY: ' + scrollY)
|
||||||
// targetDiv.css( "margin-top", originalTopMargin );
|
// targetDiv.css( 'margin-top', originalTopMargin );
|
||||||
var cssString = "translate3d(0px, "+(originalTopMargin).toString()+"px, 0px)";
|
var cssString = 'translate3d(0px, '+(originalTopMargin).toString()+'px, 0px)';
|
||||||
targetDiv.css( "-webkit-transform", cssString );
|
targetDiv.css( '-webkit-transform', cssString );
|
||||||
}
|
}
|
||||||
self.scroller = new iScroll( id );
|
self.scroller = new iScroll( id );
|
||||||
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != "" ) {
|
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != '' ) {
|
||||||
self.scroller.scrollTo( 0, parseInt( scrollY ) );
|
self.scroller.scrollTo( 0, parseInt( scrollY ) );
|
||||||
}
|
}
|
||||||
}, 10 );
|
}, 10 );
|
||||||
//this.scroller = new iScroll( id );
|
//this.scroller = new iScroll( id );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var target = $("#"+id );
|
var target = $('#'+id );
|
||||||
target.css( "overflow", "auto" );
|
target.css( 'overflow', 'auto' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -338,11 +338,11 @@ ViewNavigator.prototype.animationCompleteHandler = function(removalTarget, heade
|
||||||
self.animating = false;
|
self.animating = false;
|
||||||
self.resetScroller();
|
self.resetScroller();
|
||||||
if ( removalTarget ) {
|
if ( removalTarget ) {
|
||||||
removalTarget.unbind( "click" );
|
removalTarget.unbind( 'click' );
|
||||||
removalTarget.detach();
|
removalTarget.detach();
|
||||||
}
|
}
|
||||||
if ( headerRemovalTarget ) {
|
if ( headerRemovalTarget ) {
|
||||||
headerRemovalTarget.unbind( "click" );
|
headerRemovalTarget.unbind( 'click' );
|
||||||
headerRemovalTarget.detach();
|
headerRemovalTarget.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ ViewNavigator.prototype.S4 = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewNavigator.prototype.guid = function() {
|
ViewNavigator.prototype.guid = function() {
|
||||||
return (this.S4() + this.S4() + "-" + this.S4() + "-4" + this.S4().substr(0,3) + "-" + this.S4() + "-" + this.S4() + this.S4() + this.S4()).toLowerCase();
|
return (this.S4() + this.S4() + '-' + this.S4() + '-4' + this.S4().substr(0,3) + '-' + this.S4() + '-' + this.S4() + this.S4() + this.S4()).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -374,11 +374,11 @@ ViewNavigator.prototype.guid = function() {
|
||||||
/*
|
/*
|
||||||
//android+phonegap specific back button support - will only work if phonegap is used on android (www.phonegap.com)
|
//android+phonegap specific back button support - will only work if phonegap is used on android (www.phonegap.com)
|
||||||
if ( typeof PhoneGap != 'undefined' ) {
|
if ( typeof PhoneGap != 'undefined' ) {
|
||||||
document.addEventListener("deviceready", onDeviceReady, false);
|
document.addEventListener('deviceready', onDeviceReady, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDeviceReady() {
|
function onDeviceReady() {
|
||||||
document.addEventListener("backbutton", onBackKey, false);
|
document.addEventListener('backbutton', onBackKey, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBackKey( event ) {
|
function onBackKey( event ) {
|
||||||
|
|
Loading…
Reference in New Issue