diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2019-02-27 15:06:40 +0100 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2019-02-27 15:06:40 +0100 |
commit | b61fd46f3ac3b7b2786d629af2493b433da734a8 (patch) | |
tree | 775199902fb60007b3509f31277a23bad6140488 /js | |
parent | 84c821f6203ea06057c6c1c782da7b52006a5f34 (diff) | |
download | ematrix-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.js | 9 |
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; } |