mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 01:06:36 +01:00
Add mobile dropdown for plugin buttons (#1762)
* Add mobile toolbar buttons * cleanup * more cleanup * Mobile plugin buttons: Add else block & change icon
This commit is contained in:
@@ -104,9 +104,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
this.addButtonToToolbar = opts => {
|
||||
const buttonId = "toolbar-button-" + opts.title.replace(/\s/g, "-");
|
||||
|
||||
const button = $('<button class="noborder">')
|
||||
.addClass("btn btn-sm")
|
||||
.on('click', opts.action);
|
||||
let button;
|
||||
if (utils.isMobile()) {
|
||||
$('#plugin-buttons-placeholder').remove();
|
||||
button = $('<a class="dropdown-item" href="#">')
|
||||
.on('click', () => {
|
||||
setTimeout(() => $pluginButtons.dropdown('hide'), 0);
|
||||
});
|
||||
} else {
|
||||
button = $('<button class="noborder">')
|
||||
.addClass("btn btn-sm");
|
||||
}
|
||||
button = button.on('click', opts.action);
|
||||
|
||||
if (opts.icon) {
|
||||
button.append($("<span>").addClass("bx bx-" + opts.icon))
|
||||
|
||||
Reference in New Issue
Block a user