[imp] removed some comments
bzr revid: nicolas.vanhoren@openerp.com-20120229102321-b61kqie9t3y6cyky
This commit is contained in:
parent
db64573a8d
commit
63edbe7359
|
@ -190,17 +190,11 @@ nova = (function() {
|
|||
// http://backbonejs.org
|
||||
lib.internal.Events = lib.Class.extend({
|
||||
|
||||
// Bind an event, specified by a string name, `ev`, to a `callback`
|
||||
// function. Passing `"all"` will bind the callback to all events fired.
|
||||
on : function(events, callback, context) {
|
||||
var ev;
|
||||
events = events.split(/\s+/);
|
||||
var calls = this._callbacks || (this._callbacks = {});
|
||||
while (ev = events.shift()) {
|
||||
// Create an immutable callback list, allowing traversal during
|
||||
// modification. The tail is an empty object that will always be
|
||||
// used
|
||||
// as the next node.
|
||||
var list = calls[ev] || (calls[ev] = {});
|
||||
var tail = list.tail || (list.tail = list.next = {});
|
||||
tail.callback = callback;
|
||||
|
@ -210,11 +204,6 @@ nova = (function() {
|
|||
return this;
|
||||
},
|
||||
|
||||
// Remove one or many callbacks. If `context` is null, removes all
|
||||
// callbacks
|
||||
// with that function. If `callback` is null, removes all callbacks for
|
||||
// the
|
||||
// event. If `ev` is null, removes all bound callbacks for all events.
|
||||
off : function(events, callback, context) {
|
||||
var ev, calls, node;
|
||||
if (!events) {
|
||||
|
@ -226,8 +215,6 @@ nova = (function() {
|
|||
delete calls[ev];
|
||||
if (!callback || !node)
|
||||
continue;
|
||||
// Create a new list, omitting the indicated event/context
|
||||
// pairs.
|
||||
while ((node = node.next) && node.next) {
|
||||
if (node.callback === callback
|
||||
&& (!context || node.context === context))
|
||||
|
@ -239,11 +226,6 @@ nova = (function() {
|
|||
return this;
|
||||
},
|
||||
|
||||
// Trigger an event, firing all bound callbacks. Callbacks are passed
|
||||
// the
|
||||
// same arguments as `trigger` is, apart from the event name.
|
||||
// Listening for `"all"` passes the true event name as the first
|
||||
// argument.
|
||||
trigger : function(events) {
|
||||
var event, node, calls, tail, args, all, rest;
|
||||
if (!(calls = this._callbacks))
|
||||
|
@ -265,7 +247,6 @@ nova = (function() {
|
|||
tail : node.tail
|
||||
});
|
||||
}
|
||||
// Traverse each list, stopping when the saved tail is reached.
|
||||
rest = Array.prototype.slice.call(arguments, 1);
|
||||
while (node = events.pop()) {
|
||||
tail = node.tail;
|
||||
|
|
Loading…
Reference in New Issue