mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
remove checking current hooks for event handling (#824)
This commit is contained in:
parent
769c7b9577
commit
3559953440
3 changed files with 3 additions and 20 deletions
|
|
@ -133,15 +133,10 @@ function Button({ id, image, action, x, y, downImage, tooltip, node, children })
|
|||
return null;
|
||||
}
|
||||
|
||||
const hooks = node.js_getActiveHooks();
|
||||
const eventHandlers = {};
|
||||
if (hooks.includes("onLeftClick")) {
|
||||
eventHandlers["onClick"] = e => {
|
||||
if (hooks.includes("onLeftClick")) {
|
||||
node.js_trigger("onLeftClick");
|
||||
}
|
||||
};
|
||||
}
|
||||
eventHandlers["onClick"] = e => {
|
||||
node.js_trigger("onLeftClick");
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ class Variable {
|
|||
this._unsubscribeFromValue = value.js_listenToAll((eventName, args) => {
|
||||
this._emitter.trigger(eventName, args);
|
||||
});
|
||||
value.js_updateHooks(this, Object.keys(this._emitter._hooks));
|
||||
}
|
||||
this._value = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ class MakiObject {
|
|||
this.xmlNode = node;
|
||||
this.parent = parent;
|
||||
this.children = [];
|
||||
this.hooks = {};
|
||||
this._emitter = new Emitter();
|
||||
|
||||
if (!this.xmlNode) {
|
||||
|
|
@ -43,16 +42,6 @@ class MakiObject {
|
|||
this._emitter.dispose();
|
||||
}
|
||||
|
||||
// updating hooks like this is probably totally wrong, but just hacking for now
|
||||
js_updateHooks (node, hooks) {
|
||||
this.hooks[node] = hooks;
|
||||
}
|
||||
|
||||
js_getActiveHooks () {
|
||||
const hookArrs = Object.values(this.hooks);
|
||||
return hookArrs.reduce((acc, val) => acc.concat(val), []);
|
||||
}
|
||||
|
||||
/**
|
||||
* getClassName()
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue