From 7f1e57c2a61a24dfde33fd020039624dba515212 Mon Sep 17 00:00:00 2001 From: Harshal Dhumal Date: Mon, 6 Jun 2016 18:51:24 +0530 Subject: [PATCH] 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. --- .../templates/fts_configuration/js/fts_configuration.js | 6 +++++- .../browser/server_groups/servers/static/js/variable.js | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js index 690968cdc..132c6590b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js @@ -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 diff --git a/web/pgadmin/browser/server_groups/servers/static/js/variable.js b/web/pgadmin/browser/server_groups/servers/static/js/variable.js index 13eedd939..2d13728d9 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/variable.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/variable.js @@ -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