Skip to content
This repository
Browse code

Merge pull request #5142 from MauriceG/patch-11

Docs: Adding data-dismissable info to popup- and attribute reference
  • Loading branch information...
commit 34a32eebb80bf3837996bc10afef8f5e81c165e0 1 parent 69aec06
Anne-Gaelle Colom authored October 09, 2012
5  docs/api/data-attributes.html
@@ -496,6 +496,11 @@
496 496
 					<td><strong>true</strong> | false</td>
497 497
 				</tr>
498 498
 				<tr>
  499
+					<th>data-dismissable</th>
  500
+					<td><strong>true</strong> | false - If set to false prevents popup closing by clicking outside of the popup or pressing the Escape key</td>
  501
+				</tr>
  502
+
  503
+				<tr>
499 504
 					<th>data-overlay-theme</th>
500 505
 					<td>swatch letter (a-z) - Default "null" (transparent background)</td>
501 506
 				</tr>
10  docs/pages/popup/index.html
@@ -167,14 +167,14 @@ <h3 class="ui-title">Are you sure you want to delete this page?</h3>
167 167
 
168 168
 		<h2>Opening popups</h2>
169 169
 		
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>
171 171
 		
172 172
 <pre><code>
173 173
 $( "#myPopupDiv" ).popup( "open" )
174 174
 </code></pre>
175 175
 
176 176
 		<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>
178 178
 			
179 179
 <pre><code>
180 180
 $( "#myPopupDiv" ).popup( "close" )
@@ -192,6 +192,7 @@ <h3 class="ui-title">Are you sure you want to delete this page?</h3>
192 192
 				
193 193
 		<a href="#popupCloseRight" data-rel="popup" data-role="button" data-inline="true">Popup with close button right</a>
194 194
 		<a href="#popupCloseLeft" data-rel="popup" data-role="button" data-inline="true">Popup with close button left</a>
  195
+		<a href="#popupUndismissable" data-rel="popup" data-role="button" data-inline="true">Undismissable Popup</a>
195 196
 		
196 197
 		<div data-role="popup" id="popupCloseRight" class="ui-content" style="max-width:280px">
197 198
 			<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 @@ <h3 class="ui-title">Are you sure you want to delete this page?</h3>
203 204
 			<p>I have a close button at the top left corner with simple HTML markup.</p>
204 205
 		</div>
205 206
 		
  207
+		<div data-role="popup" id="popupUndismissable" 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
+
206 212
 		<h2>Adding padding</h2>
207 213
 		<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>
208 214
 		

0 notes on commit 34a32ee

Please sign in to comment.
Something went wrong with that request. Please try again.