Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 1872bf6

Browse files
committed
Docs: Add popups dismissable attribute info and demo (popup/index.html)
1 parent b55b93c commit 1872bf6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/pages/popup/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ <h2>Calling the popup plugin</h2>
167167

168168
<h2>Opening popups</h2>
169169

170-
<p>Using the markup-based configuration, when a link with the <code>data-rel="popup"</code> is tapped, the corresponding popup container with the id referenced in the <code>href</code> of the link will be shown. To open a popup programmatically, call popup with the <code>open</code> method on the popup container:</p>
170+
<p>Using the markup-based configuration, when a link with the <code>data-rel="popup"</code> is tapped, the corresponding popup container with the <code>id</code> referenced in the <code>href</code> of the link will be shown. To open a popup programmatically, call popup with the <code>open</code> method on the popup container:</p>
171171

172172
<pre><code>
173173
$( "#myPopupDiv" ).popup( "open" )
174174
</code></pre>
175175

176176
<h2>Closing popups</h2>
177-
<p>Popups can be closed either by clicking outside the popup widget or by pressing the <code>Esc</code> key. Popups can also be closed via the <code>close</code> method:</p>
177+
<p>By default popups can be closed either by clicking outside the popup widget or by pressing the <code>Esc</code> key. To prevent this, the <code>data-dismissable="false"</code> attribute can be added to the popup. Popups can also be closed via the <code>close</code> method:</p>
178178

179179
<pre><code>
180180
$( "#myPopupDiv" ).popup( "close" )
@@ -192,6 +192,7 @@ <h2>Closing popups</h2>
192192

193193
<a href="#popupCloseRight" data-rel="popup" data-role="button" data-inline="true">Popup with close button right</a>
194194
<a href="#popupCloseLeft" data-rel="popup" data-role="button" data-inline="true">Popup with close button left</a>
195+
<a href="#popupUnismissable" data-rel="popup" data-role="button" data-inline="true">Undismissable Popup</a>
195196

196197
<div data-role="popup" id="popupCloseRight" class="ui-content" style="max-width:280px">
197198
<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
@@ -203,6 +204,11 @@ <h2>Closing popups</h2>
203204
<p>I have a close button at the top left corner with simple HTML markup.</p>
204205
</div>
205206

207+
<div data-role="popup" id="popupUnismissable" class="ui-content" style="max-width:280px" data-dismissable="false">
208+
<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-left">Close</a>
209+
<p>I have the <code>data-dismissable</code> attribute set to <code>false</code>. I'm not closeable be clicking outside of me.</p>
210+
</div>
211+
206212
<h2>Adding padding</h2>
207213
<p>For popups with formatted text, padding is needed. We recommend adding the <code>ui-content</code> class to the popup container which adds the standard 15px of padding, just like the page content container. Write your own styles to create a more customized design if needed.</p>
208214

0 commit comments

Comments
 (0)