1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-31 08:20:37 +01:00

react to model restructure on API

This commit is contained in:
Kyle Spearrin 2017-01-10 17:01:38 -05:00
parent 605bdd0ea0
commit 39559e203a
2 changed files with 8 additions and 21 deletions

View File

@ -15,25 +15,12 @@
}
if (response.GlobalEquivalentDomains) {
for (var globalDomain in response.GlobalEquivalentDomains) {
if (response.GlobalEquivalentDomains.hasOwnProperty(globalDomain)) {
var domain = {
values: response.GlobalEquivalentDomains[globalDomain],
excluded: false,
key: globalDomain
};
if (response.ExcludedGlobalEquivalentDomains) {
for (i = 0; i < response.ExcludedGlobalEquivalentDomains.length; i++) {
if (response.ExcludedGlobalEquivalentDomains[i] === globalDomain) {
domain.excluded = true;
break;
}
}
}
$scope.globalEquivalentDomains.push(domain);
}
for (i = 0; i < response.GlobalEquivalentDomains.length; i++) {
$scope.globalEquivalentDomains.push({
domains: response.GlobalEquivalentDomains[i].Domains.join(', '),
excluded: response.GlobalEquivalentDomains[i].Excluded,
key: response.GlobalEquivalentDomains[i].Type
});
}
}
});
@ -44,7 +31,7 @@
$scope.customize = function (globalDomain) {
globalDomain.excluded = true;
$scope.equivalentDomains.push(globalDomain.values.join(', '));
$scope.equivalentDomains.push(globalDomain.domains);
}
$scope.delete = function (i) {

View File

@ -31,7 +31,7 @@
<i class="fa fa-lg fa-cut"></i>
</button>
</td>
<td ng-class="{strike: globalDomain.excluded}">{{globalDomain.values.join(', ')}}</td>
<td ng-class="{strike: globalDomain.excluded}">{{globalDomain.domains}}</td>
</tr>
</tbody>
<tbody ng-if="!globalEquivalentDomains.length">