Fix for issue 1708 - nightbuild close dialog throwing error

- Check the returned active object to see if it is valid before attempting to extract the transition out of it. Default to $.mobile.defaultDialogTransition if there is no active object.
This commit is contained in:
Kin Blas 2011-05-25 12:44:10 -07:00
parent a4ee2d5bbb
commit 923b047e75

View file

@ -45,8 +45,9 @@ $.widget( "mobile.dialog", $.mobile.widget, {
}
if( $targetel.length && !$targetel.jqmData("transition") ){
var active = $.mobile.urlHistory.getActive();
$targetel
.attr("data-" + $.mobile.ns + "transition", $.mobile.urlHistory.getActive().transition )
.attr("data-" + $.mobile.ns + "transition", ( active ? active.transition : $.mobile.defaultDialogTransition ) )
.attr("data-" + $.mobile.ns + "direction", "reverse");
}
});