Modified loadComplete() so that it always fires off the "show" event. The idea here is that calling preventDefault() on a "hide" event shouldn't prevent the "show" event from being dispatched. Calling preventDefault() on the "show" event still prevents the "to" page from becoming the active page.

Removed redundant target delcaration in the <a> live click callback.
This commit is contained in:
Kin Blas 2010-12-08 12:40:21 -08:00
parent 25c5d2697a
commit 4882c068b0

View file

@ -221,7 +221,8 @@
$.mobile.silentScroll( to.data( 'lastScroll' ) );
//trigger show/hide events, allow preventing focus change through return false
if( from.data("page")._trigger("hide", null, {nextPage: to}) !== false && to.data("page")._trigger("show", null, {prevPage: from}) !== false ){
from.data("page")._trigger("hide", null, {nextPage: to});
if( to.data("page")._trigger("show", null, {prevPage: from}) !== false ){
$.mobile.activePage = to;
}
};
@ -389,8 +390,7 @@
//if target attr is specified, it's external, and we mimic _blank... for now
target = $this.is( "[target]" ),
//if it still starts with a protocol, it's external, or could be :mailto, etc
external = target || /^(:?\w+:)/.test( href ) || $this.is( "[rel=external]" ),
target = $this.is( "[target]" );
external = target || /^(:?\w+:)/.test( href ) || $this.is( "[rel=external]" );
if( href === '#' ){
//for links created purely for interaction - ignore