Browse files

Dialog: Document _allowInteraction() extension point.

  • Loading branch information...
1 parent 4daead3 commit f60a073317fa724e11757a54f68af193589f5773 @tjvantoll tjvantoll committed Sep 26, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 entries/dialog.xml
View
16 entries/dialog.xml
@@ -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[

0 comments on commit f60a073

Please sign in to comment.