Permalink
Browse files

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.
  • Loading branch information...
1 parent e38a58a commit 0012657761c9e9c53bbced763c66993bc403370d @jblas jblas committed with Ghislain Seguin May 25, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 js/jquery.mobile.dialog.js
@@ -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");
}
});

0 comments on commit 0012657

Please sign in to comment.