diff --git a/src/javascript/controller.js b/src/javascript/controller.js index bfa2e58..b32981e 100644 --- a/src/javascript/controller.js +++ b/src/javascript/controller.js @@ -50,9 +50,9 @@ SYMPHONY.remote.hello().then(function(data) { ); - // LEFT NAV: Add an entry to the left navigation for our application - navService.add("hello-nav", "Hello World App", "hello:controller"); + var navId = "hello-nav"; + navService.add(navId, "Hello World App", "hello:controller"); // LEFT NAV: Add an extra left navigation item that can be removed by clicking on the "Remove Left Nav Item Button" navService.add("hello-nav-remove", "Removable Left Nav Item", "hello:controller"); @@ -75,17 +75,12 @@ SYMPHONY.remote.hello().then(function(data) { // LEFT NAV & MODULE: When the left navigation item is clicked on, invoke Symphony's module service to show our application in the grid select: function(id) { - if (id == "hello-nav") { - // Focus the left navigation item when clicked - navService.focus("hello-nav"); - } - modulesService.show("hello", {title: "Hello World App"}, "hello:controller", "https://localhost:4000/app.html", { // You must specify canFloat in the module options so that the module can be pinned "canFloat": true, + // Pass the nav item id for handling focus of the left navigation + "navId": navId }); - // Focus the module after it is shown - modulesService.focus("hello"); }, // UI: Execute the following when UI extensions are clicked.