aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
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;
}