add API to add plugin buttons, fixes

This commit is contained in:
azivner
2018-02-03 10:37:57 -05:00
parent 05575913db
commit 5bffba4e2f
8 changed files with 50 additions and 38 deletions

View File

@@ -0,0 +1,21 @@
const api = (function() {
const pluginButtonsEl = $("#plugin-buttons");
async function activateNote(notePath) {
await noteTree.activateNode(notePath);
}
function addButtonToToolbar(buttonId, button) {
$("#" + buttonId).remove();
button.attr('id', buttonId);
pluginButtonsEl.append(button);
}
return {
addButtonToToolbar,
activateNote
}
})();