Sha256: 934c095ec0ec355e785f87e3a69278131192c7100d6173567eed1b33578a3087

Contents?: true

Size: 1.04 KB

Versions: 15

Compression:

Stored size: 1.04 KB

Contents

JS.Observable=new JS.Module('Observable',{extend:{DEFAULT_METHOD:'update'},addObserver:function(c,b){(this.__observers__=this.__observers__||[]).push({_0:c,_1:b||null})},removeObserver:function(c,b){this.__observers__=this.__observers__||[];b=b||null;var a=this.countObservers();while(a--){if(this.__observers__[a]._0===c&&this.__observers__[a]._1===b){this.__observers__.splice(a,1);return}}},removeObservers:function(){this.__observers__=[]},countObservers:function(){return(this.__observers__=this.__observers__||[]).length},notifyObservers:function(){if(!this.isChanged())return;var c=this.countObservers(),b,a,d;while(c--){b=this.__observers__[c];a=b._0;d=b._1;if(JS.isFn(a))a.apply(d||null,arguments);else a[d||JS.Observable.DEFAULT_METHOD].apply(a,arguments)}},setChanged:function(c){this.__changed__=!(c===false)},isChanged:function(){if(this.__changed__===undefined)this.__changed__=true;return!!this.__changed__}});JS.Observable.include({subscribe:JS.Observable.instanceMethod('addObserver'),unsubscribe:JS.Observable.instanceMethod('removeObserver')},true);

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spontaneous-0.2.0.beta1 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.2.0.alpha7 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.2.0.alpha6 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.2.0.alpha5 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.2.0.alpha4 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.2.0.alpha3 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.2.0.alpha2 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.2.0.alpha1 application/js/vendor/JS.Class-2.1.5/min/observable.js
spontaneous-0.1.0.alpha1 application/js/vendor/JS.Class-2.1.5/min/observable.js
acts_as_dashboard-0.4.1 generators/dashboard/templates/js.class-2.1.4/min/observable.js
acts_as_dashboard-0.4.0 generators/dashboard/templates/js.class-2.1.4/min/observable.js
acts_as_dashboard-0.3.3 generators/dashboard/templates/js.class-2.1.4/min/observable.js
acts_as_dashboard-0.3.2 generators/dashboard/templates/js.class-2.1.4/min/observable.js
acts_as_dashboard-0.3.0 generators/dashboard/templates/js.class-2.1.4/min/observable.js
acts_as_dashboard-0.1.0 generators/dashboard/templates/js.class-2.1.4/min/observable.js