forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
511 B
21 lines
511 B
8 years ago
|
Function.prototype.before = function (func) {
|
||
|
var __self = this;
|
||
|
return function () {
|
||
|
if (func.apply(this, arguments) === false) {
|
||
|
return false;
|
||
|
}
|
||
|
return __self.apply(this, arguments);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
Function.prototype.after = function (func) {
|
||
|
var __self = this;
|
||
|
return function () {
|
||
|
var ret = __self.apply(this, arguments);
|
||
|
if (ret === false) {
|
||
|
return false;
|
||
|
}
|
||
|
func.apply(this, arguments);
|
||
|
return ret;
|
||
|
}
|
||
|
};
|