<
From version < 39.1 >
edited by Thomas Mortagne
on 2015/05/04
To version < 40.1 >
edited by Marius Dumitru Florea
on 2015/05/04
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ThomasMortagne
1 +XWiki.mflorea
Content
... ... @@ -31,10 +31,26 @@
31 31  
32 32  = For Developers =
33 33  
34 -== <developer feature N> ==
34 +== Trigger Prototype Event Listeners from jQuery ==
35 35  
36 -<description of developer feature N>
36 +The event listeners registered from Prototype are now notified when a custom XWiki event is fired using the jQuery API.
37 37  
38 +{{code language="js"}}
39 +// Prototype (old code that you don't have time to rewrite)
40 +document.observe('xwiki:dom:updated', function(event) {
41 + event.memo.elements.each(function(element) {
42 + // Do something.
43 + });
44 +});
45 +...
46 +// jQuery (new code)
47 +require(['jquery', 'xwiki-events-bridge'], function($) {
48 + $(document).trigger('xwiki:dom:updated', {'elements': $('.some-container').toArray()});
49 +});
50 +{{/code}}
51 +
52 +See the [[developer's guide>>platform:DevGuide.JavaScriptAPI||anchor="HBridgingcustomXWikieventsbetweenPrototypeandjQuery"]] for more details.
53 +
38 38  == Deprecated and Retired projects ==
39 39  
40 40  <description of deprecated and retired projects>

Get Connected