From cf7585f79bb337e1b2ad9d49754cb17093e94dc4 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 10 Sep 2015 20:51:02 +1000 Subject: [PATCH] Fixes formwidget logic leaking out of context For example: a formwidget with no tabs can exist inside a set of preview content tabs --- modules/backend/widgets/form/assets/js/october.form.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/backend/widgets/form/assets/js/october.form.js b/modules/backend/widgets/form/assets/js/october.form.js index 6d1bc2e14..336067f5f 100644 --- a/modules/backend/widgets/form/assets/js/october.form.js +++ b/modules/backend/widgets/form/assets/js/october.form.js @@ -137,6 +137,8 @@ * called multiple times in a single cycle due to input.trigger. */ FormWidget.prototype.toggleEmptyTabs = function() { + var self = this, + form = this.$el if (this.toggleEmptyTabsTimer !== undefined) { window.clearTimeout(this.toggleEmptyTabsTimer) @@ -147,7 +149,7 @@ var tabControl = $('[data-control=tab]', this.$el), tabContainer = $('.nav-tabs', tabControl) - if (!tabControl.length) + if (!tabControl.length || !$.contains(form.get(0), tabControl.get(0))) return /*