IBindable.prototype.off = function()

in lib/@uncharted/thumbnails/src/IBindable.js [69:94]


IBindable.prototype.off = function (events, callback) {
    if (events === null) {
        if (!callback) {
            this._omniHandlers.length = 0;
        } else {
            var index = this._omniHandlers.indexOf(callback);
            if (index >= 0) {
                this._omniHandlers.splice(index, 1);
            }
        }
    } else {
        events.split(' ').forEach(function (event) {
            var handlers = this._handlers[event];
            if (handlers) {
                if (!callback) {
                    delete this._handlers[event];
                } else {
                    var toRemove = handlers.indexOf(callback);
                    if (toRemove >= 0) {
                        handlers.splice(toRemove, 1);
                    }
                }
            }
        }.bind(this));
    }
};