Remove the header controls of subnode control properly, when removing it

from the VariableControl, and the customized TokenControl in the
fts_configuration javascript module during clean up process.
This commit is contained in:
Harshal Dhumal 2016-06-06 18:51:24 +05:30 committed by Ashesh Vashi
parent 9ed2530b1f
commit 7f1e57c2a6
2 changed files with 10 additions and 1 deletions

View File

@ -147,7 +147,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
// Select2 control for adding new tokens
select2: {
allowClear: true, width: 'style',
placeholder: 'Select token'
placeholder: '{{ _('Select token') }}'
},
first_empty: true,
disabled: function(m) {
@ -386,6 +386,10 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
this.listenTo(this.headerData, "select2", this.headerDataChanged);
this.listenTo(this.collection, "remove", this.onAddorRemoveTokens);
// Remove header controls.
_.each(this.controls, function(control) {
control.remove();
});
TokenControl.__super__.remove.apply(this, arguments);
// Remove the header model

View File

@ -570,6 +570,11 @@
this.listenTo(this.headerData, "select2", this.headerDataChanged);
this.listenTo(this.collection, "remove", this.onRemoveVariable);
// Remove header controls.
_.each(this.controls, function(control) {
control.remove();
});
VariableCollectionControl.__super__.remove.apply(this, arguments);
// Remove the header model