From 200d11713697689661350afd81799287495a2cbd Mon Sep 17 00:00:00 2001 From: Roman Chyla Date: Thu, 30 Jul 2015 18:37:26 -0400 Subject: [PATCH] QBuilder: fixed the tests --- src/js/components/query_builder/plugin.js | 11 +++++++++++ test/mocha/qb-suite.js | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) 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',