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
16 entries/dialog.xml
@@ -345,6 +345,22 @@
<xi:include href="../includes/widget-method-option.xml" xmlns:xi=""/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi=""/>
+ <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 !!$( ).is( ".select2-input" ) || this._super( event );
+ </example>
+ </method>
+ </extension-points>
<desc>A simple jQuery UI Dialog</desc>

0 comments on commit f60a073

Please sign in to comment.