mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
fix empty template message after expanding
This commit is contained in:
parent
0f19d98d84
commit
fc4c9af86f
@ -12,9 +12,17 @@ function atSyntaxHighlightController ($scope, AngularCodeMirror) {
|
||||
}
|
||||
$scope.value = $scope.value || $scope.default;
|
||||
|
||||
initCodeMirror();
|
||||
|
||||
$scope.$watch(varName, () => {
|
||||
$scope.value = $scope[varName];
|
||||
});
|
||||
}
|
||||
|
||||
function initCodeMirror () {
|
||||
$scope.varName = varName;
|
||||
$scope[varName] = $scope.value;
|
||||
const codeMirror = AngularCodeMirror($scope.disabled);
|
||||
const codeMirror = AngularCodeMirror(!!$scope.disabled);
|
||||
codeMirror.addModes({
|
||||
jinja2: {
|
||||
mode: $scope.mode,
|
||||
@ -34,10 +42,6 @@ function atSyntaxHighlightController ($scope, AngularCodeMirror) {
|
||||
lineNumbers: true,
|
||||
mode: $scope.mode,
|
||||
});
|
||||
|
||||
$scope.$watch(varName, () => {
|
||||
$scope.value = $scope[varName];
|
||||
});
|
||||
}
|
||||
|
||||
vm.name = $scope.name;
|
||||
@ -48,6 +52,9 @@ function atSyntaxHighlightController ($scope, AngularCodeMirror) {
|
||||
angular.element(document).ready(() => {
|
||||
init();
|
||||
});
|
||||
$scope.$on('reset-code-mirror', () => {
|
||||
initCodeMirror();
|
||||
});
|
||||
}
|
||||
|
||||
atSyntaxHighlightController.$inject = [
|
||||
|
||||
@ -153,6 +153,14 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$watch('customize_messages', (value) => {
|
||||
if (value) {
|
||||
$scope.$broadcast('reset-code-mirror', {
|
||||
customize_messages: $scope.customize_messages,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$scope.emailOptionsChange = function () {
|
||||
if ($scope.email_options === 'use_ssl') {
|
||||
if ($scope.use_ssl) {
|
||||
|
||||
@ -237,6 +237,14 @@ export default ['Rest', 'Wait',
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$watch('customize_messages', (value) => {
|
||||
if (value) {
|
||||
$scope.$broadcast('reset-code-mirror', {
|
||||
customize_messages: $scope.customize_messages,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$scope.emailOptionsChange = function () {
|
||||
if ($scope.email_options === 'use_ssl') {
|
||||
if ($scope.use_ssl) {
|
||||
|
||||
@ -598,7 +598,7 @@ export default ['i18n', function(i18n) {
|
||||
rows: 2,
|
||||
},
|
||||
start_body: {
|
||||
label: i18n._('Start Body'),
|
||||
label: i18n._('Start Expanded Message'),
|
||||
class: 'Form-formGroup--fullWidth',
|
||||
type: 'syntax_highlight',
|
||||
mode: 'jinja2',
|
||||
@ -615,7 +615,7 @@ export default ['i18n', function(i18n) {
|
||||
rows: 2,
|
||||
},
|
||||
success_body: {
|
||||
label: i18n._('Success Body'),
|
||||
label: i18n._('Success Expanded Message'),
|
||||
class: 'Form-formGroup--fullWidth',
|
||||
type: 'syntax_highlight',
|
||||
mode: 'jinja2',
|
||||
@ -632,7 +632,7 @@ export default ['i18n', function(i18n) {
|
||||
rows: 2,
|
||||
},
|
||||
error_body: {
|
||||
label: i18n._('Error Body'),
|
||||
label: i18n._('Error Expanded Message'),
|
||||
class: 'Form-formGroup--fullWidth',
|
||||
type: 'syntax_highlight',
|
||||
mode: 'jinja2',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user