Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions js/jquery.mobile.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ $.widget( "mobile.dialog", $.mobile.widget, {
closeBtnText: "Close"
},
_create: function() {
var self = this,
$el = self.element;
var $el = this.element;

/* class the markup for dialog styling */
this.element
$el
//add ARIA role
.attr( "role", "dialog" )
.addClass( "ui-page ui-dialog ui-body-a" )
Expand All @@ -34,17 +33,11 @@ $.widget( "mobile.dialog", $.mobile.widget, {
unless a data-transition is specified on the link/form
- if the click was on the close button, or the link has a data-rel="back" it'll go back in history naturally
*/
this.element
$el
.bind( "vclick submit", function( e ) {
var $target;
if( e.type == "vclick" ){
$target = $( e.target ).closest( "a" );
}
else{
$target = $( e.target ).closest( "form" );
}
var $target = $( e.target ).closest( e.type === "vclick" ? "a" : "form" );

if( $target.length && !$target.jqmData("transition") ){
if( $target.length && ! $target.jqmData( "transition" ) ) {
var active = $.mobile.urlHistory.getActive() || {};
$target
.attr( "data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) )
Expand Down