Skip to content

Commit

Permalink
Dialog: Document _allowInteraction() extension point.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjvantoll committed Sep 26, 2013
1 parent 4daead3 commit f60a073
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions entries/dialog.xml
Expand Up @@ -345,6 +345,22 @@
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
<extension-points>
<method name="_allowInteraction" return="Boolean">
<desc>
Modal dialogs do not allow users to interact with elements behind the dialog. This can be problematic for elements that are not children of the dialog, but are absolutely positioned to appear as though they are. The <code>_allowInteraction()</code> method determines whether the user should be allowed to interact with a given target element; therefore, it can be used to whitelist elements that are not children of the dialog but you want users to be able to use.
</desc>
<argument name="event" type="Event"/>
<example>
<desc>Allow the Select2 plugin to be used within modal dialogs. The <a href="/jquery.widget/#method-_super"><code>_super()</code></a> call ensures elements within the dialog can still be interacted with.</desc>
<code><![CDATA[
_allowInteraction: function( event ) {
return !!$( event.target ).is( ".select2-input" ) || this._super( event );
}
]]></code>
</example>
</method>
</extension-points>
<example>
<desc>A simple jQuery UI Dialog</desc>
<code><![CDATA[
Expand Down

0 comments on commit f60a073

Please sign in to comment.