diff --git a/js/app/controllers/menu.js b/js/app/controllers/menu.js index 5e8c125d..ab33bbb0 100644 --- a/js/app/controllers/menu.js +++ b/js/app/controllers/menu.js @@ -226,26 +226,26 @@ $scope.buildVaultList(args); }); + $scope.informVaultJs = function (event) { + var caller = event.target || event.srcElement; + console.log( caller ); + $rootScope.$broadcast('vault_listelement_clicked', caller.getAttribute("guid")); + }; + $scope.buildVaultList = function (vaults) { var list = document.getElementById("app-navigation-vaultlist"); for (var j = 0; j < vaults.length; j++){ var li = document.createElement("li"); - - li.setAttribute("ng-click", "selectVault(vaults[j])"); - - var guid = vaults[j].guid; - li.onclick = function(){ - $rootScope.$broadcast('vault_listelement_clicked', guid); - }; + li.onclick = $scope.informVaultJs; var a = document.createElement("a"); + a.setAttribute("guid", vaults[j].guid); a.classList="icon-category-security svg"; a.textContent = vaults[j].name; + li.appendChild(a); list.appendChild(li); - - //a.onclick = $scope.selectVault(vaults[j]); } var newVault = document.getElementById("app-navigation-vaultlist-new"); diff --git a/js/app/controllers/vault.js b/js/app/controllers/vault.js index 5dae4789..2d89667b 100644 --- a/js/app/controllers/vault.js +++ b/js/app/controllers/vault.js @@ -57,10 +57,11 @@ $scope.creating_vault = false; $scope.vault_selected = true; + console.log("show vault "+guid); for (var i = 0; i < vaults.length; i++) { if(vaults[i].guid === guid){ $scope.selectVault(vaults[i]); - console.log("show vault "+guid); + console.log("found vault "+guid); } } });