Skip to content

Commit 4a67c78

Browse files
Fixed the loadout bug again...
1 parent 6b57385 commit 4a67c78

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

app/scripts/loadout/dimLoadout.directive.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@
7373
vm.show = true;
7474
dimLoadoutService.dialogOpen = true;
7575

76-
vm.loadout = _.clone(vm.defaults);
76+
vm.loadout = angular.copy(vm.defaults);
7777
});
7878

7979
scope.$on('dim-delete-loadout', function(event, args) {
8080
vm.show = false;
8181
dimLoadoutService.dialogOpen = false;
82-
vm.loadout = _.clone(vm.defaults);
82+
vm.loadout = angular.copy(vm.defaults);
8383
});
8484

8585
scope.$on('dim-edit-loadout', function(event, args) {
@@ -115,7 +115,7 @@
115115
classType: -1,
116116
items: {}
117117
};
118-
vm.loadout = _.clone(vm.defaults);
118+
vm.loadout = angular.copy(vm.defaults);
119119

120120
vm.save = function save() {
121121
if (_.has(vm.loadout, 'id')) {
@@ -124,19 +124,19 @@
124124
dimLoadoutService.saveLoadout(vm.loadout);
125125
}
126126

127-
vm.loadout = _.clone(vm.defaults);
127+
vm.loadout = angular.copy(vm.defaults);
128128
vm.show = false;
129129
dimLoadoutService.dialogOpen = false;
130130
};
131131

132132
vm.cancel = function cancel() {
133-
vm.loadout = _.clone(vm.defaults);
133+
vm.loadout = angular.copy(vm.defaults);
134134
dimLoadoutService.dialogOpen = false;
135135
vm.show = false;
136136
};
137137

138138
vm.add = function add(item) {
139-
var clone = _.clone(item);
139+
var clone = angular.copy(item);
140140

141141
var discriminator = clone.type.toLowerCase();
142142
var typeInventory = vm.loadout.items[discriminator] = (vm.loadout.items[discriminator] || []);

app/scripts/loadout/dimLoadoutPopup.directive.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
vm.deleteLoadout = function deleteLoadout(loadout, $event) {
6464
dimLoadoutService.deleteLoadout(loadout);
65+
$rootScope.$broadcast('dim-delete-loadout', {});
6566

6667
dimLoadoutService.getLoadouts()
6768
.then(function(loadouts) {

0 commit comments

Comments
 (0)