Skip to content

Commit 72b1e41

Browse files
committed
Accordion / Tabs: Document that the activate event is not fired on creation. Fixes jquery#156.
1 parent 24e977a commit 72b1e41

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

entries/accordion.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@
120120
</options>
121121
<events>
122122
<event name="activate">
123-
<desc>Triggered after a panel has been activated (after animation completes). If the accordion was previously collapsed, <code>ui.oldHeader</code> and <code>ui.oldPanel</code> will be empty jQuery objects. If the accordion is collapsing, <code>ui.newHeader</code> and <code>ui.newPanel</code> will be empty jQuery objects.</desc>
123+
<desc>
124+
<p>Triggered after a panel has been activated (after animation completes). If the accordion was previously collapsed, <code>ui.oldHeader</code> and <code>ui.oldPanel</code> will be empty jQuery objects. If the accordion is collapsing, <code>ui.newHeader</code> and <code>ui.newPanel</code> will be empty jQuery objects.</p>
125+
<div class="warning"><strong>Note:</strong> Since the <code>activate</code> event is only fired on panel activation, it is not fired for the initial panel when the accordion widget is created. If you need a hook for widget creation use the <a href="#event-create"><code>create</code></a> event.</div>
126+
</desc>
124127
<argument name="event" type="Event"/>
125128
<argument name="ui" type="Object">
126129
<property name="newHeader" type="jQuery">

entries/tabs.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@
100100
</options>
101101
<events>
102102
<event name="activate">
103-
<desc>Triggered after a tab has been activated (after animation completes). If the tabs were previously collapsed, <code>ui.oldTab</code> and <code>ui.oldPanel</code> will be empty jQuery objects. If the tabs are collapsing, <code>ui.newTab</code> and <code>ui.newPanel</code> will be empty jQuery objects.</desc>
103+
<desc>
104+
<p>Triggered after a tab has been activated (after animation completes). If the tabs were previously collapsed, <code>ui.oldTab</code> and <code>ui.oldPanel</code> will be empty jQuery objects. If the tabs are collapsing, <code>ui.newTab</code> and <code>ui.newPanel</code> will be empty jQuery objects.</p>
105+
<div class="warning"><strong>Note:</strong> Since the <code>activate</code> event is only fired on tab activation, it is not fired for the initial tab when the tabs widget is created. If you need a hook for widget creation use the <a href="#event-create"><code>create</code></a> event.</div>
106+
</desc>
104107
<argument name="event" type="Event"/>
105108
<argument name="ui" type="Object">
106109
<property name="newTab" type="jQuery">

0 commit comments

Comments
 (0)