Fixes formwidget logic leaking out of context

For example: a formwidget with no tabs can exist inside a set of preview content tabs
This commit is contained in:
Samuel Georges 2015-09-10 20:51:02 +10:00
parent 9812e1f4ec
commit cf7585f79b
1 changed files with 3 additions and 1 deletions

View File

@ -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
/*