Skip to content

Commit

Permalink
Dialog: fixed links not working in dialogs. Fixed jquery-archive#448
Browse files Browse the repository at this point in the history
…- Dialog: clicking link in dialog closes dialog and doesn't do anything else
  • Loading branch information
medovob authored and Scott Jehl committed Nov 16, 2010
1 parent c413b2f commit 791f7aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/jquery.mobile.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ $.widget( "mobile.dialog", $.mobile.widget, {
$closeBtn = $('<a href="#" data-icon="delete" data-iconpos="notext">Close</a>');

$el.delegate("a, submit", "click submit", function(e){
if( e.type == "click" && ( $(e.target).closest('[data-back]') || $(e.target).closest($closeBtn) ) ){

if( e.type == "click" && ( $(e.target).closest('[data-back]')[0] || this==$closeBtn[0] ) ){
self.close();
return false;
}
//otherwise, assume we're headed somewhere new. set activepage to dialog so the transition will work
$.mobile.activePage = this.element;
$.mobile.activePage = self.element;
});

this.element
Expand Down

0 comments on commit 791f7aa

Please sign in to comment.