mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 18:07:36 -02:30
codemirror: sync data when closing modal by clicking outside
This commit is contained in:
@@ -28,6 +28,13 @@ function atCodeMirrorModalController (
|
|||||||
setTimeout(resize, 0);
|
setTimeout(resize, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.close = () => {
|
||||||
|
$scope.closeFn({
|
||||||
|
values: $scope.modalVars,
|
||||||
|
parseType: $scope.modalParseType,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function init () {
|
function init () {
|
||||||
if ($scope.disabled === 'true') {
|
if ($scope.disabled === 'true') {
|
||||||
$scope.disabled = true;
|
$scope.disabled = true;
|
||||||
@@ -43,7 +50,7 @@ function atCodeMirrorModalController (
|
|||||||
readOnly: $scope.disabled
|
readOnly: $scope.disabled
|
||||||
});
|
});
|
||||||
resize();
|
resize();
|
||||||
$(CodeMirrorModalID).on('hidden.bs.modal', $scope.closeFn);
|
$(CodeMirrorModalID).on('hidden.bs.modal', $scope.close);
|
||||||
$(`${CodeMirrorModalID} .modal-dialog`).resizable({
|
$(`${CodeMirrorModalID} .modal-dialog`).resizable({
|
||||||
minHeight: 523,
|
minHeight: 523,
|
||||||
minWidth: 600
|
minWidth: 600
|
||||||
@@ -53,12 +60,6 @@ function atCodeMirrorModalController (
|
|||||||
|
|
||||||
vm.strings = strings;
|
vm.strings = strings;
|
||||||
vm.toggle = toggle;
|
vm.toggle = toggle;
|
||||||
$scope.close = () => {
|
|
||||||
$scope.closeFn({
|
|
||||||
values: $scope.modalVars,
|
|
||||||
parseType: $scope.modalParseType,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
if ($scope.init) {
|
if ($scope.init) {
|
||||||
$scope.init = init;
|
$scope.init = init;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user