X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Observable.js;h=46cb8a27d7b83cc7eef6b7fea230f9b983b90f94;hb=ed4af3f1932dceb4d6d98f39c5ce6341509e98d3;hp=02fb42b925437054d502361650b1193197502d98;hpb=9ebcd0f6645cde009d5b5e29789195b163ed32b3;p=app.Builder.js diff --git a/Observable.js b/Observable.js index 02fb42b92..46cb8a27d 100644 --- a/Observable.js +++ b/Observable.js @@ -89,9 +89,9 @@ Observable = XObject.define( * @param {Object} options (optional) An object containing handler configuration * properties. This may contain any of the following properties:
@@ -189,11 +189,26 @@ Observable = XObject.define( } } }, - + _combine : function(){ + var as = arguments, l = as.length, r = []; + for(var i = 0; i < l; i++){ + var a = as[i]; + if(a instanceof Array){ + r = r.concat(a); + }else if(a.length !== undefined && !a.substr){ + r = r.concat(Array.prototype.slice.call(a, 0)); + }else{ + r.push(a); + } + } + return r; + }, + relayEvents : function(o, events){ var createHandler = function(ename){ return function(){ - return this.fireEvent.apply(this, Roo.combine(ename, Array.prototype.slice.call(arguments, 0))); + return this.fireEvent.apply(this, Event.prototype.combine(ename, + Array.prototype.slice.call(arguments, 0))); }; }; for(var i = 0, len = events.length; i < len; i++){ @@ -223,7 +238,7 @@ Observable = XObject.define( var e = this.events[eventName]; return typeof e == "object" && e.listeners.length > 0; } -}; +}); /** * Starts capture on the specified Observable. All events will be passed @@ -259,7 +274,7 @@ var createSingle = function(h, e, fn, scope){ // NOT SUPPORTED YET> //var createBuffered = function(h, o, scope){ -// var task = new Roo.DelayedTask(); +// var task = new DelayedTask(); // return function(){ // task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0)); // }; @@ -276,11 +291,16 @@ var createSingle = function(h, e, fn, scope){ //}; +/** + * Event Object - manages a specific event. + * + * + * + */ - -Event = XObject.define({ +Event = XObject.define( function(obj, name){ this.name = name; this.obj = obj;