From 127e749d1f970c03b974a4ff5e6ded1c9c18ac9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 12 Oct 2010 10:49:53 -0400 Subject: [PATCH 01/11] Basic page for testing speed and responsiveness of events. --- speed/basic-page.html | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 speed/basic-page.html diff --git a/speed/basic-page.html b/speed/basic-page.html new file mode 100644 index 00000000..70a054f5 --- /dev/null +++ b/speed/basic-page.html @@ -0,0 +1,53 @@ + + + + Basic Page + + + + + + +
+
+

Basic Page

+
+
+

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Vestibulum id ligula porta felis euismod semper. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam.

+ +

Aenean lacinia bibendum nulla sed consectetur. Sed posuere consectetur est at lobortis. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.

+ +

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Sed posuere consectetur est at lobortis. Vestibulum id ligula porta felis euismod semper. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+ +

Vestibulum id ligula porta felis euismod semper. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Donec id elit non mi porta gravida at eget metus. Cras justo odio, dapibus ac facilisis in, egestas eget quam.

+ +

Maecenas faucibus mollis interdum. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. Aenean lacinia bibendum nulla sed consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur blandit tempus porttitor.

+ +

Vestibulum id ligula porta felis euismod semper. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

+ +

Maecenas faucibus mollis interdum. Donec sed odio dui. Maecenas faucibus mollis interdum. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras mattis consectetur purus sit amet fermentum. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+ +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

+ +

Curabitur blandit tempus porttitor. Vestibulum id ligula porta felis euismod semper. Nulla vitae elit libero, a pharetra augue. Nullam quis risus eget urna mollis ornare vel eu leo. Maecenas sed diam eget risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+ +

Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

+ +

Aenean lacinia bibendum nulla sed consectetur. Curabitur blandit tempus porttitor. Nullam id dolor id nibh ultricies vehicula ut id elit.

+ +

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam id dolor id nibh ultricies vehicula ut id elit. Nulla vitae elit libero, a pharetra augue.

+ +

Nullam quis risus eget urna mollis ornare vel eu leo. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nulla vitae elit libero, a pharetra augue. Maecenas sed diam eget risus varius blandit sit amet non magna.

+
+
+ + \ No newline at end of file From 89b0c2dcb72bd7bd060f2711013b54c8a6524dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 12 Oct 2010 10:56:32 -0400 Subject: [PATCH 02/11] Fixed reference to JS file. --- speed/basic-page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speed/basic-page.html b/speed/basic-page.html index 70a054f5..6bb28fc6 100644 --- a/speed/basic-page.html +++ b/speed/basic-page.html @@ -3,7 +3,7 @@ Basic Page - + From b83885d28113ba066d127c808c72bc8d4b40a396 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 12 Oct 2010 10:08:02 -0400 Subject: [PATCH 05/11] brought back active scope - didn't help to remove it --- js/jquery.mobile.fixHeaderFooter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index 065203d7..6695b54c 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -18,7 +18,7 @@ $.fixedToolbars = (function(){ var currentstate = 'inline', delayTimer, ignoreTargets = 'a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed', - toolbarSelector = '.ui-header-fixed, .ui-footer-fixed:not(.ui-footer-duplicate)', //removed scope temporarily - these used to be scoped to ui-page-active + toolbarSelector = '.ui-page-active .ui-header-fixed, .ui-page-active .ui-footer-fixed:not(.ui-footer-duplicate)', stickyFooter, //for storing quick references to duplicate footers supportTouch = $.support.touch, touchStartEvent = supportTouch ? "touchstart" : "mousedown", From c99b047333af22cb84f23de59031750b6b17c5cb Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 12 Oct 2010 11:13:24 -0400 Subject: [PATCH 06/11] only apply show/hide to first header, last footer on page --- js/jquery.mobile.fixHeaderFooter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index 6695b54c..ebce6383 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -18,7 +18,7 @@ $.fixedToolbars = (function(){ var currentstate = 'inline', delayTimer, ignoreTargets = 'a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed', - toolbarSelector = '.ui-page-active .ui-header-fixed, .ui-page-active .ui-footer-fixed:not(.ui-footer-duplicate)', + toolbarSelector = '.ui-page-active .ui-header-fixed:first, .ui-page-active .ui-footer-fixed:not(.ui-footer-duplicate):last', stickyFooter, //for storing quick references to duplicate footers supportTouch = $.support.touch, touchStartEvent = supportTouch ? "touchstart" : "mousedown", From d5aff26c157cdfcecca2498dbee3c70d2bab27cc Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 12 Oct 2010 11:21:13 -0400 Subject: [PATCH 07/11] set overflow to auto instead. --- css/jquery.mobile.core.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/jquery.mobile.core.css b/css/jquery.mobile.core.css index e1127e92..7ecf09c7 100644 --- a/css/jquery.mobile.core.css +++ b/css/jquery.mobile.core.css @@ -29,7 +29,7 @@ /* "page" containers - full-screen views, one should always be in view post-pageload */ .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; z-index: 10; visibility: hidden; height: 0; overflow: hidden; border: 0; } -.ui-page-active { visibility: visible; overflow: visible; } +.ui-page-active { visibility: visible; overflow: auto; } /* loading screen */ .ui-loading, .ui-loading body { overflow: hidden !important; } From ddd18e5ec7213569b8099389a0d30f5206a09ad9 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 12 Oct 2010 11:24:14 -0400 Subject: [PATCH 08/11] send focus to first page title, not any old page title. Just in case - prevents page jumps --- js/jquery.mobile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js index 862c2e56..b80ca8ab 100644 --- a/js/jquery.mobile.js +++ b/js/jquery.mobile.js @@ -145,7 +145,7 @@ //for directing focus to the page title, or otherwise first focusable element function reFocus(page){ - var pageTitle = page.find( ".ui-title" ); + var pageTitle = page.find( ".ui-title:eq(0)" ); if( pageTitle.length ){ pageTitle.focus(); } From 85c3e74f62cb511078a66f568b320f93cb783aac Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 12 Oct 2010 11:40:06 -0400 Subject: [PATCH 09/11] back to overflow:visible for mobile webkit's sake... oops --- css/jquery.mobile.core.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/jquery.mobile.core.css b/css/jquery.mobile.core.css index 7ecf09c7..e1127e92 100644 --- a/css/jquery.mobile.core.css +++ b/css/jquery.mobile.core.css @@ -29,7 +29,7 @@ /* "page" containers - full-screen views, one should always be in view post-pageload */ .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; z-index: 10; visibility: hidden; height: 0; overflow: hidden; border: 0; } -.ui-page-active { visibility: visible; overflow: auto; } +.ui-page-active { visibility: visible; overflow: visible; } /* loading screen */ .ui-loading, .ui-loading body { overflow: hidden !important; } From 7339965765a46676117c489993e4a03173ccf9de Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 12 Oct 2010 11:43:11 -0400 Subject: [PATCH 10/11] polling setTop on an interval to test for improvements. --- js/jquery.mobile.fixHeaderFooter.js | 44 ++++++++++++++++++----------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index ebce6383..00a5a0a3 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -84,24 +84,34 @@ $.fixedToolbars = (function(){ }); function setTop(el){ - var fromTop = $(window).scrollTop(), - thisTop = el.offset().top, - thisCSStop = el.css('top') == 'auto' ? 0 : parseFloat(el.css('top')), - screenHeight = window.innerHeight, - thisHeight = el.outerHeight(), - useRelative = el.parents('.ui-page:not(.ui-page-fullscreen)').length, - relval; - if( el.is('.ui-header-fixed') ){ - relval = fromTop - thisTop + thisCSStop; - if( relval < thisTop){ relval = 0; } - return el.css('top', ( useRelative ) ? relval : fromTop); - } - else{ - relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight); - if( relval > thisTop ){ relval = 0; } - return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight ); - } + el.each(function(){ + var el = $(this), + fromTop = $(window).scrollTop(), + thisTop = el.offset().top, + thisCSStop = el.css('top') == 'auto' ? 0 : parseFloat(el.css('top')), + screenHeight = window.innerHeight, + thisHeight = el.outerHeight(), + useRelative = el.parents('.ui-page:not(.ui-page-fullscreen)').length, + relval; + if( el.is('.ui-header-fixed') ){ + relval = fromTop - thisTop + thisCSStop; + if( relval < thisTop){ relval = 0; } + return el.css('top', ( useRelative ) ? relval : fromTop); + } + else{ + relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight); + if( relval > thisTop ){ relval = 0; } + return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight ); + } + }); } + + //timeout to work around current event issues. + setInterval(function(){ + if( currentstate == 'overlay' ){ + setTop($(toolbarSelector)); + } + }, 50); //exposed methods return { From a9e984a06232d96de980ded929d6b87ac97da495 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 12 Oct 2010 11:43:32 -0400 Subject: [PATCH 11/11] made sure inner shadow is applied differently on search inputs --- js/jquery.mobile.forms.textinput.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/jquery.mobile.forms.textinput.js b/js/jquery.mobile.forms.textinput.js index b91ccced..a36fbd7c 100644 --- a/js/jquery.mobile.forms.textinput.js +++ b/js/jquery.mobile.forms.textinput.js @@ -16,13 +16,13 @@ jQuery.fn.customTextInput = function(options){ $('label[for='+input.attr('id')+']').addClass('ui-input-text'); - input.addClass('ui-input-text ui-shadow-inset ui-body-'+ o.theme); + input.addClass('ui-input-text ui-body-'+ o.theme); var focusedEl = input; //"search" input widget if(o.search){ - focusedEl = input.wrap('').parent(); + focusedEl = input.wrap('').parent(); var clearbtn = $('clear text') .buttonMarkup({icon: 'delete', iconpos: 'notext', corners:true, shadow:true}) .click(function(){ @@ -46,7 +46,7 @@ jQuery.fn.customTextInput = function(options){ input.keyup(toggleClear); } else{ - input.addClass('ui-corner-all'); + input.addClass('ui-corner-all ui-shadow-inset'); } input