mirror of
https://github.com/nextcloud/passman.git
synced 2024-11-15 04:22:03 +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.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) {
|
$scope.buildVaultList = function (vaults) {
|
||||||
var list = document.getElementById("app-navigation-vaultlist");
|
var list = document.getElementById("app-navigation-vaultlist");
|
||||||
|
|
||||||
for (var j = 0; j < vaults.length; j++){
|
for (var j = 0; j < vaults.length; j++){
|
||||||
var li = document.createElement("li");
|
var li = document.createElement("li");
|
||||||
|
li.onclick = $scope.informVaultJs;
|
||||||
li.setAttribute("ng-click", "selectVault(vaults[j])");
|
|
||||||
|
|
||||||
var guid = vaults[j].guid;
|
|
||||||
li.onclick = function(){
|
|
||||||
$rootScope.$broadcast('vault_listelement_clicked', guid);
|
|
||||||
};
|
|
||||||
|
|
||||||
var a = document.createElement("a");
|
var a = document.createElement("a");
|
||||||
|
a.setAttribute("guid", vaults[j].guid);
|
||||||
a.classList="icon-category-security svg";
|
a.classList="icon-category-security svg";
|
||||||
a.textContent = vaults[j].name;
|
a.textContent = vaults[j].name;
|
||||||
|
|
||||||
li.appendChild(a);
|
li.appendChild(a);
|
||||||
list.appendChild(li);
|
list.appendChild(li);
|
||||||
|
|
||||||
//a.onclick = $scope.selectVault(vaults[j]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var newVault = document.getElementById("app-navigation-vaultlist-new");
|
var newVault = document.getElementById("app-navigation-vaultlist-new");
|
||||||
|
|
|
@ -57,10 +57,11 @@
|
||||||
$scope.creating_vault = false;
|
$scope.creating_vault = false;
|
||||||
$scope.vault_selected = true;
|
$scope.vault_selected = true;
|
||||||
|
|
||||||
|
console.log("show vault "+guid);
|
||||||
for (var i = 0; i < vaults.length; i++) {
|
for (var i = 0; i < vaults.length; i++) {
|
||||||
if(vaults[i].guid === guid){
|
if(vaults[i].guid === guid){
|
||||||
$scope.selectVault(vaults[i]);
|
$scope.selectVault(vaults[i]);
|
||||||
console.log("show vault "+guid);
|
console.log("found vault "+guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue