Confirmed users
764
edits
(→id: Not yet implemented) |
(→Example Usage: Added note about OS X menu platform bug) |
||
| Line 501: | Line 501: | ||
Add a "Recent Tweets" submenu to the Jetpack menu. (Assume we've defined a <code>getRecentTweets()</code>, which invokes a callback with an array of strings.) When the menu is shown, it displays a "Loading..." item. If the menu remains open when <code>getRecentTweets()</code> receives data from the network and calls <code>done()</code>, the "Loading..." item is replaced with the tweets, one item per tweet. | Add a "Recent Tweets" submenu to the Jetpack menu. (Assume we've defined a <code>getRecentTweets()</code>, which invokes a callback with an array of strings.) When the menu is shown, it displays a "Loading..." item. If the menu remains open when <code>getRecentTweets()</code> receives data from the network and calls <code>done()</code>, the "Loading..." item is replaced with the tweets, one item per tweet. | ||
<span style="background: #fdd">''This example will not work on OS X due to a platform bug in Firefox. Replace <tt>jetpack.menu.add</tt> with <tt>jetpack.menu.context.page</tt> to see the effect on the content context menu.''</span> | |||
<pre class="brush:js;"> | <pre class="brush:js;"> | ||