Skip to content

Instantly share code, notes, and snippets.

@sdesai
Created August 8, 2012 00:01
Show Gist options
  • Save sdesai/3290740 to your computer and use it in GitHub Desktop.
Save sdesai/3290740 to your computer and use it in GitHub Desktop.
var MS = function(config) {
// Since you won't be mixing in Y.ModelSync.REST
// as a separate extensions
Y.ModelSync.REST.apply(this, arguments);
};
Y.mix(MS, Y.ModelSync.REST); // Mainly to pull over ModelSync.REST.ATTRS, but maybe other stuff also.
Y.mix(MS.prototype, Y.ModelSync.REST.prototype);
MS.prototype.getURL : function (action, options) {
if (Lang.isArray(this._shelves)) {
return this.root;
}
// other conditions here
return Y.ModelSync.REST.prototype.getURL.apply(this, arguments);
};
MS.prototype.sync = function() {
if (someoverridecondition) {
// new logic
} else {
Y.ModelSync.REST.prototype.sync.apply(this, arguments);
}
};
Y.GalleryModelSync = MS;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment