aboutsummaryrefslogtreecommitdiffstats
path: root/stella.js
diff options
context:
space:
mode:
Diffstat (limited to 'stella.js')
-rw-r--r--stella.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/stella.js b/stella.js
index 505d7c8..95b7f30 100644
--- a/stella.js
+++ b/stella.js
@@ -1858,13 +1858,13 @@ Thanks:
let self = this;
function setEvents (name, elem) {
- ['click', 'popupshowing'].forEach(function (eventName) {
+ ['click', 'command', 'popupshowing'].forEach(function (eventName) {
let onEvent = self['on' + U.capitalize(name) + U.capitalize(eventName)];
onEvent && elem.addEventListener(eventName, function (event) {
- if (eventName != 'click' || event.button == 0) {
- onEvent.apply(self, arguments);
- self.update();
- }
+ if (eventName == 'click' && event.button != 0)
+ return;
+ onEvent.apply(self, arguments);
+ self.update();
}, false);
});
}
@@ -2104,7 +2104,7 @@ Thanks:
rel instanceof RelatedTag ? 'Tag: ' :
'';
elem.setAttribute('label', prefix + rel.description);
- elem.addEventListener('click', clickEvent(rel.command), false);
+ elem.addEventListener('command', clickEvent(rel.command), false);
relmenu.appendChild(elem);
}, this);
},