Fix console error when changing kind(SQL/BATCH) for pgAgent job step. Fixes #4582

This commit is contained in:
Aditya Toshniwal
2019-08-08 18:43:38 +05:30
committed by Akshay Joshi
parent 350ffcce7c
commit 1281f5cd6c
3 changed files with 10 additions and 15 deletions

View File

@@ -45,10 +45,10 @@ define('pgadmin.node.pga_jobstep', [
is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
if (is_editable) {
this.$el.addClass('editable');
input.bootstrapSwitch('disabled', false);
input.bootstrapToggle('disabled', false);
} else {
this.$el.removeClass('editable');
input.bootstrapSwitch('disabled', true);
input.bootstrapToggle('disabled', true);
// Set self value into model
setTimeout(function () {
model.set(self_name, true);
@@ -209,18 +209,8 @@ define('pgadmin.node.pga_jobstep', [
},{
id: 'jstcode', label: '', cell: 'string', deps: ['jstkind'],
type: 'text', group: gettext('Code'),
control: Backform.SqlFieldControl.extend({
render: function() {
if (this.model.get('jstkind')) {
this.field.set('label', gettext('SQL query'));
} else {
this.field.set('label', gettext('Script'));
}
return Backform.SqlFieldControl.prototype.render.apply(
this, arguments
);
},
}),
tabPanelCodeClass: 'sql-code-control',
control: Backform.SqlCodeControl,
}],
validate: function() {
var val = this.get('jstname'),