mirror of
https://github.com/nextcloud/passman.git
synced 2024-11-14 20:06:17 +08:00
Fix selection of different vaults by propagating the correct guid
Signed-off-by: Felix Nüsse <felix.nuesse@t-online.de>
This commit is contained in:
parent
0247ed2f6a
commit
3f72d429be
2 changed files with 11 additions and 10 deletions
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue