diff --git a/src/js/components/query_builder/plugin.js b/src/js/components/query_builder/plugin.js index d62a430a0..c756c51be 100644 --- a/src/js/components/query_builder/plugin.js +++ b/src/js/components/query_builder/plugin.js @@ -597,6 +597,10 @@ define([ * */ isDirty: function(queryToCompare) { + + if (!this.$el.data('queryBuilder')) + return false; + try { var formQ = this.getQuery(); @@ -647,6 +651,13 @@ define([ this.$el.on('keypress.input', function(ev) { throttled(); }); + }, + + destroy: function() { + + this.$el.off('change.queryBuilder'); + this.$el.off('click.queryBuilder'); + this.$el.off('keypress.input'); } }); diff --git a/test/mocha/qb-suite.js b/test/mocha/qb-suite.js index ba9255a2b..402efb2cd 100644 --- a/test/mocha/qb-suite.js +++ b/test/mocha/qb-suite.js @@ -1,7 +1,6 @@ define([], function() { var tests = [ - '/widgets/search_bar_widget.spec.js', '/components/query_builder/plugin.spec.js', '/components/query_builder/rules_translator.spec.js', '/components/query_builder/translation_query2ui.spec.js',