diff --git a/src/public/app/services/app_context.js b/src/public/app/services/app_context.js index f1db21f6e..72050fd07 100644 --- a/src/public/app/services/app_context.js +++ b/src/public/app/services/app_context.js @@ -34,9 +34,7 @@ class AppContext extends Component { this.tabManager.loadTabs(); - if (utils.isDesktop()) { - setTimeout(() => bundleService.executeStartupBundles(), 2000); - } + setTimeout(() => bundleService.executeStartupBundles(), 2000); } showWidgets() { diff --git a/src/public/app/services/bundle.js b/src/public/app/services/bundle.js index 1ab93ded8..24e294b1c 100644 --- a/src/public/app/services/bundle.js +++ b/src/public/app/services/bundle.js @@ -2,6 +2,7 @@ import ScriptContext from "./script_context.js"; import server from "./server.js"; import toastService from "./toast.js"; import treeCache from "./tree_cache.js"; +import utils from "./utils.js"; async function getAndExecuteBundle(noteId, originEntity = null) { const bundle = await server.get('script/bundle/' + noteId); @@ -25,7 +26,8 @@ async function executeBundle(bundle, originEntity, $container) { } async function executeStartupBundles() { - const scriptBundles = await server.get("script/startup"); + const isMobile = utils.isMobile(); + const scriptBundles = await server.get("script/startup" + (isMobile ? "?mobile=true" : "")); for (const bundle of scriptBundles) { await executeBundle(bundle); diff --git a/src/public/app/services/frontend_script_api.js b/src/public/app/services/frontend_script_api.js index 561c3b229..2f23853eb 100644 --- a/src/public/app/services/frontend_script_api.js +++ b/src/public/app/services/frontend_script_api.js @@ -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 = $('