Created
June 8, 2012 15:13
-
-
Save toddpi314/2896094 to your computer and use it in GitHub Desktop.
Rich_Domain_Concepts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Namespace.Register("DeepElement.ThreeOneFour.Component") | |
/* | |
* Represents a Javascript Component Baseclass that supports async | |
* loading/unloading | |
* | |
*/ | |
DeepElement.ThreeOneFour.Component = new Class({ | |
Implements: Events, | |
loaded: false, | |
initialize: function() {}, | |
load: function(success, failure) { | |
if (!this.loaded) { | |
this.loaded = true; | |
if (success != null) success(); | |
} | |
}, | |
unload: function(success, failure) { | |
if (this.loaded) { | |
this.loaded = false; | |
if (success != null) success(); | |
} | |
}, | |
getLoaded: function() { | |
return this.loaded; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment