Fixed stuck host add/edit dialog

The dialog would not go away after clicking save. Issue was bad applicaiton of code from 1.4.11. Also fixed missing fa-cut icon.
This commit is contained in:
Chris Houseknecht
2014-06-06 13:43:18 -04:00
parent 3a5db149e9
commit e96444ac8f
2 changed files with 11 additions and 12 deletions

View File

@@ -615,19 +615,15 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
scope.removeSaveCompleted(); scope.removeSaveCompleted();
} }
scope.removeSaveCompleted = scope.$on('saveCompleted', function() { scope.removeSaveCompleted = scope.$on('saveCompleted', function() {
if (scope.removeSaveCompleted) { try {
scope.removeSaveCompleted(); $('#host-modal-dialog').dialog('close');
} }
scope.removeSaveCompleted = scope.$on('saveCompleted', function() { catch(err) {
try { // ignore
$('#host-modal-dialog').dialog('close'); }
} console.log('calling refreshHosts()');
catch(err) { group_scope.refreshHosts();
// ignore scope.$destroy();
}
group_scope.refreshHosts();
scope.$destroy();
});
}); });
// Save changes to the parent // Save changes to the parent

View File

@@ -150,6 +150,9 @@ angular.module('GeneratorHelpers', [])
case 'job_details': case 'job_details':
icon = 'fa-list-ul'; icon = 'fa-list-ul';
break; break;
case 'copy':
icon = "fa-cut";
break;
} }
icon += (size) ? " " + size : ""; icon += (size) ? " " + size : "";
return Icon(icon); return Icon(icon);