Skip to content

Commit

Permalink
Emit event for success
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesús Ángel committed Jan 30, 2019
1 parent a4d147f commit bc77c35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/controllers/management/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ export function GroupsController(
$scope.$broadcast('saveXmlFile', { group: $scope.currentGroup.name });
};

$scope.$on('configurationSuccess',() => {
$scope.editingFile = false;
if(!$scope.$$phase) $scope.$digest();
});

$scope.reload = async (element, searchTerm, addOffset, start) => {
if (element === 'left') {
if (!$scope.availableAgents.loadedAll) {
Expand Down
2 changes: 2 additions & 0 deletions public/directives/wz-xml-file-editor/wz-xml-file-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ app.directive('wzXmlFileEditor', function() {
const xml = replaceIllegalXML(text);
await groupHandler.sendConfiguration(params.group, xml);
errorHandler.info('Success. Group has been updated', '');
$scope.$emit('configurationSuccess')
} catch (error) {
errorHandler.handle(error, 'Send file error');
}
return;
};

$scope.xmlCodeBox = CodeMirror.fromTextArea(
$document[0].getElementById('xml_box'),
{
Expand Down

0 comments on commit bc77c35

Please sign in to comment.