less underscore

This commit is contained in:
antelle 2019-09-17 23:48:31 +02:00
parent 08d7261488
commit 3341f3e7f6
2 changed files with 5 additions and 7 deletions

View File

@ -43,9 +43,9 @@ class KeyHandler {
offKey(key, handler, thisArg) {
if (this.shortcuts[key]) {
this.shortcuts[key] = _.reject(this.shortcuts[key], sh => {
return sh.handler === handler && sh.thisArg === thisArg;
});
this.shortcuts[key] = this.shortcuts[key].filter(
sh => sh.handler !== handler || sh.thisArg !== thisArg
);
}
}

View File

@ -183,10 +183,8 @@ Tip.hideTip = function(el) {
Tip.updateTip = function(el, props) {
if (el._tip) {
el._tip.hide();
Object.assign(
el._tip,
_.pick(props, ['title', 'placement', 'fast', 'showTimeout', 'hideTimeout'])
);
const { title, placement, fast, showTimeout, hideTimeout } = props;
Object.assign(el._tip, { title, placement, fast, showTimeout, hideTimeout });
}
};