mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Simplified SAVE STATE events, added wrap method to easily build decorators
This commit is contained in:
@@ -47,5 +47,13 @@ if (typeof Function.prototype.bind !== "function") {
|
||||
extendedObject.prototype.superclass = inheritFrom.prototype;
|
||||
};
|
||||
|
||||
ns.wrap = function (wrapper, wrappedObject) {
|
||||
for (var prop in wrappedObject) {
|
||||
if (typeof wrappedObject[prop] === 'function') {
|
||||
wrapper[prop] = wrappedObject[prop].bind(wrappedObject);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user