From 923b047e7589aa8f204bc5c3df5f76e02409124e Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Wed, 25 May 2011 12:44:10 -0700 Subject: [PATCH] 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. --- js/jquery.mobile.dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 012d036e..fe0776d5 100644 --- a/js/jquery.mobile.dialog.js +++ b/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"); } });