events.js
19 lines
| 625 B
| application/javascript
|
JavascriptLexer
Jonathan Frederic
|
r17189 | // Copyright (c) IPython Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||||
Brian Granger
|
r6047 | |||
// Give us an object to bind all events to. This object should be created | ||||
// before all other objects so it exists when others register event handlers. | ||||
// To trigger an event handler: | ||||
Brian Granger
|
r7168 | // $([IPython.events]).trigger('event.Namespace'); | ||
Brian Granger
|
r6047 | // To handle it: | ||
// $([IPython.events]).on('event.Namespace',function () {}); | ||||
Jonathan Frederic
|
r17189 | define(['base/js/namespace'], function(IPython) { | ||
Matthias BUSSONNIER
|
r12103 | "use strict"; | ||
Brian Granger
|
r6047 | |||
var Events = function () {}; | ||||
Jonathan Frederic
|
r17193 | |||
Jonathan Frederic
|
r17189 | // Backwards compatability. | ||
Brian Granger
|
r6047 | IPython.Events = Events; | ||
Jonathan Frederic
|
r17195 | |||
Jonathan Frederic
|
r17201 | return {'Events': Events}; | ||
Jonathan Frederic
|
r17189 | }); | ||