aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorAlessio Vanni <vannilla@firemail.cc>2019-02-27 15:06:40 +0100
committerAlessio Vanni <vannilla@firemail.cc>2019-02-27 15:06:40 +0100
commitb61fd46f3ac3b7b2786d629af2493b433da734a8 (patch)
tree775199902fb60007b3509f31277a23bad6140488 /js
parent84c821f6203ea06057c6c1c782da7b52006a5f34 (diff)
downloadematrix-b61fd46f3ac3b7b2786d629af2493b433da734a8.tar.lz
ematrix-b61fd46f3ac3b7b2786d629af2493b433da734a8.tar.xz
ematrix-b61fd46f3ac3b7b2786d629af2493b433da734a8.zip
Let the toolbar button honor spacers in toolbar
Diffstat (limited to 'js')
-rw-r--r--js/vapi-background.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/vapi-background.js b/js/vapi-background.js
index f2d176c..54380a0 100644
--- a/js/vapi-background.js
+++ b/js/vapi-background.js
@@ -2473,7 +2473,14 @@ vAPI.toolbarButton = {
// Found our button on this toolbar - but where on it?
var before = null;
for ( var i = index + 1; i < currentset.length; i++ ) {
- before = toolbar.querySelector('[id="' + currentset[i] + '"]');
+ if (currentset[i] === 'spacer') {
+ // The [id=...] notation doesn't work on
+ // 'toolbarspacer' elements.
+ // https://gitlab.com/vannilla/ematrix/issues/5
+ before = toolbar.querySelector('toolbarspacer');
+ } else {
+ before = toolbar.querySelector('[id="'+currentset[i]+'"]');
+ }
if ( before !== null ) {
break;
}