Skip to content

Instantly share code, notes, and snippets.

@walm
Created April 13, 2011 10:36
Show Gist options
  • Save walm/917334 to your computer and use it in GitHub Desktop.
Save walm/917334 to your computer and use it in GitHub Desktop.
JooseX triggers on attributes in before/after for class in initialize
initialize : function ( props ) {
var self = this;
var triggerCallback = function ( newValue, oldValue ) {
var attribute = this;
if ( !attribute.isChanged ) {
attribute.isChanged = newValue != oldValue;
}
}
for (var key in self.meta.attributes ) {
var attribute = self.meta.attributes[key];
if ( attribute.is.indexOf('p') != -1 &&
attribute.writeable ) {
attribute.isChanged = false;
attribute.trigger = triggerCallback;
}
}
} //- end #initialize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment