Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for Event Listens Propagate argument. #7103

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add documentation for Event Listens Propagate argument. Fixes #6912
  • Loading branch information
Olivier Riffaud committed Apr 19, 2020
commit 08dee9cb663a41260f2c85dcd218e86a2416b0eb
4 changes: 2 additions & 2 deletions docs/reference-1.0.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -19773,9 +19773,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.1.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -19903,9 +19903,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.2.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -19918,9 +19918,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.3.4.html
Original file line number Diff line number Diff line change
Expand Up @@ -20120,9 +20120,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.4.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -20133,9 +20133,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.6.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -21025,9 +21025,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
3 changes: 2 additions & 1 deletion src/core/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ export var Events = {
return this;
},

// @method listens(type: String): Boolean
// @method listens(type: String, propagate?: Boolean): Boolean
// Returns `true` if a particular event type has any listeners attached to it.
// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.
listens: function (type, propagate) {
var listeners = this._events && this._events[type];
if (listeners && listeners.length) { return true; }
Expand Down