Simplify injection scope for removeOn* methods.

This commit is contained in:
Jürg Lehni 2011-11-12 13:22:45 +01:00
parent a326b189b4
commit b1332331b0

View file

@ -1820,7 +1820,13 @@ var Item = this.Item = Base.extend(/** @lends Item# */{
} }
} }
} }
}, new function() { }, Base.each(['down', 'drag', 'up', 'move'], function(name) {
this['removeOn' + Base.capitalize(name)] = function() {
var hash = {};
hash[name] = true;
return this.removeOn(hash);
};
}, /** @lends Item# */{
/** /**
* {@grouptitle Remove On Event} * {@grouptitle Remove On Event}
* *
@ -1934,15 +1940,7 @@ var Item = this.Item = Base.extend(/** @lends Item# */{
* path.removeOnUp(); * path.removeOnUp();
* } * }
*/ */
// TODO: implement Item#removeOnFrame // TODO: implement Item#removeOnFrame
return Base.each(['down', 'drag', 'up', 'move'], function(name) {
this['removeOn' + Base.capitalize(name)] = function() {
var hash = {};
hash[name] = true;
return this.removeOn(hash);
};
}, {
removeOn: function(obj) { removeOn: function(obj) {
for (var name in obj) { for (var name in obj) {
if (obj[name]) { if (obj[name]) {
@ -1954,5 +1952,4 @@ var Item = this.Item = Base.extend(/** @lends Item# */{
} }
return this; return this;
} }
}); }));
});