1
0
mirror of https://github.com/moparisthebest/app-UI synced 2024-12-21 23:18:52 -05:00

changed indent: spaces to tab

spaces and tabs were mixed. Changed all spaces to tabs. Also deleted
all spaces in empty lines.
This commit is contained in:
Andre Meyering 2013-01-23 14:49:16 +01:00
parent ebdf914795
commit 6a767743bd
6 changed files with 295 additions and 297 deletions

View File

@ -169,7 +169,7 @@ SlidingView.prototype.snapToPosition = function() {
useTranslate3d: true
}, 100);
this.sidebar.trigger( "slidingViewProgress", { current:targetX, max:this.sidebarWidth } );
this.sidebar.trigger( "slidingViewProgress", { current:targetX, max:this.sidebarWidth } );
}
}
@ -193,10 +193,10 @@ SlidingView.prototype.getTouchCoordinates = function(event) {
SlidingView.prototype.resizeContent = function() {
var $window = $(window)
var w = $window.width();
var h = $window.height();
var w = $window.width();
var h = $window.height();
this.body.width( w );
this.body.width( w );
}

View File

@ -80,42 +80,42 @@ SplitViewNavigator.prototype.resizeContent = function() {
SplitViewNavigator.prototype.applyStylesByOrientation = function() {
var $window = $(window)
var w = $window.width();
var h = $window.height();
var w = $window.width();
var h = $window.height();
var orientation = (w >= h) ? "landscape" : "portrait";
this.contentOverlay.removeClass( "content_overlay_visible" ).addClass( "content_overlay_hidden" );
var orientation = (w >= h) ? "landscape" : "portrait";
this.contentOverlay.removeClass( "content_overlay_visible" ).addClass( "content_overlay_hidden" );
//landscape
if ( orientation == "landscape" && this.orientation != orientation ) {
this.sidebarContainer.removeClass( "sidebar_portrait" ).addClass( "sidebar_landscape" );
this.bodyViewNavigator.setHeaderPadding( 0 );
this.toggleSidebarButton.remove();
if ( this.animationPerformed ) {
this.sidebarContainer.css( "left", 0 );
}
this.bodyContainer.removeClass( "body_portrait" ).addClass( "body_landscape" );
}
//landscape
if ( orientation == "landscape" && this.orientation != orientation ) {
this.sidebarContainer.removeClass( "sidebar_portrait" ).addClass( "sidebar_landscape" );
this.bodyViewNavigator.setHeaderPadding( 0 );
this.toggleSidebarButton.remove();
if ( this.animationPerformed ) {
this.sidebarContainer.css( "left", 0 );
}
this.bodyContainer.removeClass( "body_portrait" ).addClass( "body_landscape" );
}
//portrait
else if ( this.orientation != orientation ) {
this.sidebarContainer.removeClass( "sidebar_landscape" ).addClass( "sidebar_portrait" );
this.bodyViewNavigator.setHeaderPadding( "70px" );
//portrait
else if ( this.orientation != orientation ) {
this.sidebarContainer.removeClass( "sidebar_landscape" ).addClass( "sidebar_portrait" );
this.bodyViewNavigator.setHeaderPadding( "70px" );
this.bodyContainer.append( this.toggleSidebarButton );
if ( this.animationPerformed ) {
this.sidebarContainer.css( "left", -this.sidebarContainer.width() );
}
this.bodyContainer.removeClass( "body_landscape" ).addClass( "body_portrait" );
}
if ( this.animationPerformed ) {
this.sidebarContainer.css( "left", -this.sidebarContainer.width() );
}
this.bodyContainer.removeClass( "body_landscape" ).addClass( "body_portrait" );
}
this.orientation = orientation;
this.orientation = orientation;
}
SplitViewNavigator.prototype.showSidebar = function() {
this.animationPerformed = true;
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.sidebarContainer.animate({
left:0,
@ -128,7 +128,7 @@ SplitViewNavigator.prototype.showSidebar = function() {
SplitViewNavigator.prototype.hideSidebar = function() {
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.sidebarContainer.animate({
left:-this.sidebarContainer.width(),
@ -143,7 +143,7 @@ SplitViewNavigator.prototype.animationCompleteHandler = function() {
var self = this;
return function() {
self.animating = false;
//self.resetScroller();
//self.resetScroller();
}
}
@ -177,7 +177,7 @@ SplitViewNavigator.prototype.replaceBodyView = function( viewDescriptor ) {
//GUID logic from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
SplitViewNavigator.prototype.S4 = function() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
SplitViewNavigator.prototype.guid = function() {

View File

@ -32,7 +32,7 @@ body {
padding: 0px;
margin: 0px;
backface-visibility: hidden;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transform: translate3d(0,0,0);
@ -62,7 +62,7 @@ body {
background: linear-gradient(top, rgba(167,207,223,1) 0%,rgba(35,83,138,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a7cfdf', endColorstr='#23538a',GradientType=0 ); /* IE6-9 */
backface-visibility: hidden;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transform: translate3d(0,0,0);
@ -76,11 +76,11 @@ body {
z-index:2;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
max-width:30%;
max-width:30%;
}
.viewNavigator_header_title {
@ -95,16 +95,16 @@ body {
font-weight: bold;
color: #FFFFFF;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
max-width:48%;
max-width:48%;
}
.viewNavigator_headerContent {
backface-visibility: hidden;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transform: translate3d(0,0,0);
@ -121,7 +121,7 @@ body {
bottom:0px;
overflow:hidden;
backface-visibility: hidden;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transform: translate3d(0,0,0);
@ -133,23 +133,23 @@ body {
.viewNavigator_content select {
overflow:auto;
position:relative;
backface-visibility: auto;
backface-visibility: auto;
-webkit-backface-visibility: auto;
}
.viewNavigator_contentHolder > div:first-child {
min-height:100%;
border-bottom:1px solid #444;
border-top:1px solid #444;
min-height:100%;
border-bottom:1px solid #444;
border-top:1px solid #444;
}
.viewNavigator_content div {
backface-visibility: visible;
-webkit-backface-visibility: visible;
-webkit-transform: translate3d(0,0,0);
backface-visibility: visible;
-webkit-backface-visibility: visible;
-webkit-transform: translate3d(0,0,0);
}
.viewNavigator_contentHolder {
@ -162,12 +162,12 @@ body {
overflow:auto;
padding:0px;
margin:0px;
overflow: hidden;
overflow: hidden;
-webkit-overflow-scrolling : touch;
min-width:100%;
min-height:100%
backface-visibility: hidden;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transform: translate3d(0,0,0);

View File

@ -131,10 +131,10 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
this.resizeContent();
if ( this.contentPendingRemove ){
this.contentPendingRemove.stop()
this.contentPendingRemove.stop()
}
if ( this.headerContentPendingRemove ) {
this.headerContentPendingRemove.stop()
this.headerContentPendingRemove.stop()
}
this.headerContent.stop()
this.contentViewHolder.stop()
@ -142,25 +142,25 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
if ( this.scroller != null ) {
var scrollY = this.scroller.y;
this.scroller.destroy();
this.scroller = null;
var scrollY = this.scroller.y;
this.scroller.destroy();
this.scroller = null;
if (this.contentPendingRemove) {
//console.log( scrollY );
if (this.contentPendingRemove) {
//console.log( scrollY );
//use this to mantain scroll position when scroller is destroyed
var children = $( this.contentPendingRemove.children()[0] );
children.attr( "scrollY", scrollY );
var originalTopMargin = children.css( "margin-top" );
children.attr( "originalTopMargin", originalTopMargin );
//use this to mantain scroll position when scroller is destroyed
var children = $( this.contentPendingRemove.children()[0] );
children.attr( "scrollY", scrollY );
var originalTopMargin = children.css( "margin-top" );
children.attr( "originalTopMargin", originalTopMargin );
var cssString = "translate3d(0px, "+(parseInt( scrollY ) + parseInt( originalTopMargin )).toString()+"px, 0px)";
children.css( "-webkit-transform", cssString );
var cssString = "translate3d(0px, "+(parseInt( scrollY ) + parseInt( originalTopMargin )).toString()+"px, 0px)";
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; });
@ -169,93 +169,93 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
this.contentViewHolder.css( "left", -this.contentViewHolder.width() );
this.contentViewHolder.css( "opacity", 1 );
this.content.prepend( this.contentViewHolder );
this.content.prepend( this.contentViewHolder );
this.headerContent.css( "left", -this.animationX );
this.headerContent.css( "opacity", 0 );
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 );
this.contentPendingRemove.animate({
left:this.contentViewHolder.width(),
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration*0.8);
this.contentPendingRemove.animate({
left:this.contentViewHolder.width(),
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration*0.8);
//remove this to change back
this.contentViewHolder.animate({
left:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration/2);
//remove this to change back
this.contentViewHolder.animate({
left:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration/2);
this.headerContentPendingRemove.animate({
left:this.animationX,
opacity:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration, func );
this.headerContentPendingRemove.animate({
left:this.animationX,
opacity:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration, func );
this.headerContent.animate({
left:0,
opacity:1,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration/2 );
this.headerContent.animate({
left:0,
opacity:1,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration/2 );
//using a timeout to get around inconsistent response times for webkittransitionend event
//var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
//setTimeout( func, this.animationDuration+90 );
//using a timeout to get around inconsistent response times for webkittransitionend event
//var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
//setTimeout( func, this.animationDuration+90 );
}
else if ( this.history.length > 1 ) {
this.contentViewHolder.css( "left", this.contentViewHolder.width() );
this.contentViewHolder.css( "opacity", 1 );
this.content.append( this.contentViewHolder );
this.content.append( this.contentViewHolder );
this.headerContent.css( "left", this.animationX );
this.headerContent.css( "opacity", 0 );
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 );
this.contentViewHolder.animate({
left:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration*0.75);
this.contentViewHolder.animate({
left:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration*0.75);
this.contentPendingRemove.animate({
left:-this.contentViewHolder.width()/2,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration, func);
this.contentPendingRemove.animate({
left:-this.contentViewHolder.width()/2,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration, func);
this.headerContent.animate({
left:0,
opacity:1,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration*0.75);
this.headerContent.animate({
left:0,
opacity:1,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration*0.75);
this.headerContentPendingRemove.animate({
left:-this.animationX,
opacity:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration );
this.headerContentPendingRemove.animate({
left:-this.animationX,
opacity:0,
avoidTransforms:false,
useTranslate3d: true
}, this.animationDuration );
//using a timeout to get around inconsistent response times for webkittransitionend event
//var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
//setTimeout( func, this.animationDuration+90 );
//using a timeout to get around inconsistent response times for webkittransitionend event
//var func = this.animationCompleteHandler(this.contentPendingRemove, this.headerContentPendingRemove, this.headerContent, this.contentViewHolder );
//setTimeout( func, this.animationDuration+90 );
}
else {
this.contentViewHolder.css( "left", 0 );
this.contentViewHolder.css( "opacity", 1 );
this.content.append( this.contentViewHolder );
this.content.append( this.contentViewHolder );
this.headerContent.css( "left", 0 );
this.headerContent.css( "opacity", 1 );
@ -264,12 +264,12 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) {
this.resetScroller();
}
if ( viewDescriptor.backLabel ) {
new NoClickDelay( this.headerBacklink.get()[0] );
if ( viewDescriptor.backLabel ) {
new NoClickDelay( this.headerBacklink.get()[0] );
}
if ( viewDescriptor.showCallback ) {
viewDescriptor.showCallback();
viewDescriptor.showCallback();
}
}
@ -281,45 +281,45 @@ ViewNavigator.prototype.destroyScroller = function() {
this.scroller.destroy();
this.scroller = null;
}
}
}
}
ViewNavigator.prototype.resetScroller = function() {
var id = this.contentViewHolder.attr( "id" );
var currentViewDescriptor = this.history[ this.history.length-1];
this.destroyScroller();
var id = this.contentViewHolder.attr( "id" );
var currentViewDescriptor = this.history[ this.history.length-1];
this.destroyScroller();
if ( !this.winPhone ) {
if ( id && !(currentViewDescriptor && currentViewDescriptor.scroll == false)) {
var self = this;
if ( 'ontouchstart' in window ){
setTimeout( function() {
setTimeout( function() {
//use this to mantain scroll position when scroller is destroyed
var targetDiv = $( $("#"+id ).children()[0] );
var scrollY= targetDiv.attr( "scrollY" );
var originalTopMargin = targetDiv.attr( "originalTopMargin" );
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != "" ){
// console.log( "resetScroller scrollY: " + scrollY)
// targetDiv.css( "margin-top", originalTopMargin );
var cssString = "translate3d(0px, "+(originalTopMargin).toString()+"px, 0px)";
targetDiv.css( "-webkit-transform", cssString );
}
self.scroller = new iScroll( id );
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != "" ) {
self.scroller.scrollTo( 0, parseInt( scrollY ) );
}
}, 10 );
//this.scroller = new iScroll( id );
//use this to mantain scroll position when scroller is destroyed
var targetDiv = $( $("#"+id ).children()[0] );
var scrollY= targetDiv.attr( "scrollY" );
var originalTopMargin = targetDiv.attr( "originalTopMargin" );
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != "" ){
// console.log( "resetScroller scrollY: " + scrollY)
// targetDiv.css( "margin-top", originalTopMargin );
var cssString = "translate3d(0px, "+(originalTopMargin).toString()+"px, 0px)";
targetDiv.css( "-webkit-transform", cssString );
}
self.scroller = new iScroll( id );
if ( currentViewDescriptor.maintainScrollPosition !== false && scrollY != undefined && scrollY != "" ) {
self.scroller.scrollTo( 0, parseInt( scrollY ) );
}
}, 10 );
//this.scroller = new iScroll( id );
}
else {
var target = $("#"+id );
target.css( "overflow", "auto" );
var target = $("#"+id );
target.css( "overflow", "auto" );
}
}
}
}
}
@ -329,14 +329,14 @@ ViewNavigator.prototype.refreshScroller = function() {
if ( this.scroller != null ) {
this.scroller.refresh();
}
}
}
}
ViewNavigator.prototype.animationCompleteHandler = function(removalTarget, headerRemovalTarget, headerView, contentView) {
var self = this;
return function() {
self.animating = false;
self.resetScroller();
self.resetScroller();
if ( removalTarget ) {
removalTarget.unbind( "click" );
removalTarget.detach();
@ -361,7 +361,7 @@ ViewNavigator.prototype.resizeContent = function(event) {
//GUID logic from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
ViewNavigator.prototype.S4 = function() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
ViewNavigator.prototype.guid = function() {
@ -393,5 +393,3 @@ function onBackKey( event ) {
//block page scrolling
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);