various tweaks and bug fixes

This commit is contained in:
Andrew Trice 2012-03-28 21:06:07 -04:00
parent 1ab501ca87
commit 8275d00eaa
8 changed files with 30 additions and 49 deletions

View File

@ -11,12 +11,11 @@
<script src="../../../src/slidingview/slidingview.js"></script>
<script>
$(document).ready( function() {
//Setup the ViewNavigator
new SlidingView( 'sidebar', 'body' );
} );

View File

@ -105,7 +105,7 @@
</head>
<body>
<div class="slidingview_wrapper">
<div class="slidingview_wrapper">
<div id="sidebar">sidebar here!</div>
<div id="body">body here!</div>
</div>

View File

@ -28,7 +28,7 @@
//Setup the ViewNavigator
new SplitViewNavigator( 'body' );
new SplitViewNavigator( 'body', "Menu" );
window.splitViewNavigator.pushSidebarView( sidebarViewDescriptor );
window.splitViewNavigator.pushBodyView( bodyViewDescriptor );

View File

@ -164,10 +164,12 @@
var actor = movie.abridged_cast[i];
html += "<li><strong>" + actor.name + ":</strong> ";
for ( var j = 0; j < actor.characters.length; j ++ )
{
if ( j > 0 ) { html += ", " };
html += actor.characters[j];
if ( actor.characters ) {
for ( var j = 0; j < actor.characters.length; j ++ )
{
if ( j > 0 ) { html += ", " };
html += actor.characters[j];
}
}
html += "</li>";
@ -196,7 +198,7 @@
//Setup the ViewNavigator
new SplitViewNavigator( 'body' );
new SplitViewNavigator( 'body', "Movies" );
window.splitViewNavigator.pushSidebarView( controller.rootView );
window.splitViewNavigator.pushBodyView( defaultView );

View File

@ -51,7 +51,7 @@
border:0;
}
li {
.viewNavigator_content li {
padding:0 10px;
border-bottom:1px solid #ccc;
height:40px; line-height:40px;
@ -151,10 +151,12 @@
var actor = movie.abridged_cast[i];
html += "<li><strong>" + actor.name + ":</strong> ";
for ( var j = 0; j < actor.characters.length; j ++ )
{
if ( j > 0 ) { html += ", " };
html += actor.characters[j];
if ( actor.characters ) {
for ( var j = 0; j < actor.characters.length; j ++ )
{
if ( j > 0 ) { html += ", " };
html += actor.characters[j];
}
}
html += "</li>";
@ -174,15 +176,8 @@
backCallback: callback,
view: $(html)
};
/*var listItems = controller.rootView.view.find( "li" );
listItems.each(function(index, li) {
var item = $(li).get(0);
NoClickDelay( item );
});*/
window.viewNavigator.pushView( viewDescriptor);
}

View File

@ -1,4 +1,4 @@
var SplitViewNavigator = function( target ) {
var SplitViewNavigator = function( target, toggleButtonLabel ) {
this.animating = false;
this.animationDuration = 350;
@ -19,20 +19,7 @@ var SplitViewNavigator = function( target ) {
this.bodyViewNavigator = new ViewNavigator( this.bodyContainer.get()[0] );
/*
this.bodyHeader = $('<div class="viewNavigator_header"></div>');
this.bodyContent = $('<div class="viewNavigator_content" id="contentRoot"></div>');
this.bodyContainer.append( this.bodyHeader );
this.bodyContainer.append( this.bodyContent );
this.bodyHeaderContent = $('<div class="viewNavigator_headerContent"></div>');
this.bodyHeaderTitle = $("<div class='viewNavigator_header_title'></div>");
this.bodyHeaderContent.append( this.bodyHeaderTitle );
this.bodyHeader.append( this.bodyHeaderContent );
*/
this.toggleSidebarButton = $('<li class="viewNavigator_header_backlink backLinkButton hidden" id="toggle' + this.uniqueId + '" onclick="window.splitViewNavigator.showSidebar()">toggle</li>');
this.toggleSidebarButton = $('<li class="viewNavigator_header_backlink backLinkButton hidden" id="toggle' + this.uniqueId + '" onclick="window.splitViewNavigator.showSidebar()">'+toggleButtonLabel+'</li>');
this.rootElement.append( this.bodyContainer );
this.rootElement.append( this.contentOverlay );

View File

@ -1,7 +1,13 @@
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-user-select: none;
}
input,
textarea {
-webkit-touch-callout: auto;
-webkit-user-select: auto;
}

View File

@ -33,15 +33,6 @@ var ViewNavigator = function( target ) {
}
window.viewNavigators[ this.uniqueId ] = this;
if ( typeof PhoneGap != 'undefined' ) {
//backKeyViewNavigators is only used in PhoneGap on Android
if ( window.backKeyViewNavigators == null || window.backKeyViewNavigators == undefined ) {
window.backKeyViewNavigators = [];
}
if ( this.supportsBackKey ) {
window.backKeyViewNavigators.push( this );
}
}
}
ViewNavigator.prototype.replaceView = function( viewDescriptor ) {
@ -278,7 +269,7 @@ ViewNavigator.prototype.guid = function() {
/* PHONEGAP INTEGRATION */
/*
//android+phonegap specific back button support - will only work if phonegap is used on android (www.phonegap.com)
if ( typeof PhoneGap != 'undefined' ) {
document.addEventListener("deviceready", onDeviceReady, false);
@ -295,3 +286,4 @@ function onBackKey( event ) {
window.backKeyViewNavigators[x].popView();
}
}
*/