From 0e140f9cfbfd909b3e367b63be97440002943e00 Mon Sep 17 00:00:00 2001 From: Jasper de Groot Date: Sun, 16 Dec 2012 21:35:42 +0100 Subject: [PATCH] Dialog: Append close button to first found header to prevent a close button being added to popup on same page as well. Fixes #5382. --- js/widgets/dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/widgets/dialog.js b/js/widgets/dialog.js index ad123fc9ff1..ac55ded60e8 100644 --- a/js/widgets/dialog.js +++ b/js/widgets/dialog.js @@ -86,7 +86,7 @@ $.widget( "mobile.dialog", $.mobile.widget, { // Sanitize value location = ( value === "left" ? "left" : "right" ); btn = $( ""+ this.options.closeBtnText + "" ); - this.element.children().find( ":jqmData(role='header')" ).prepend( btn ); + this.element.children().find( ":jqmData(role='header')" ).first().prepend( btn ); if ( this._createComplete && $.fn.buttonMarkup ) { btn.buttonMarkup(); }