mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Immediately load a lazy tab if it is the initial active tab.
Fixes #4879
This commit is contained in:
parent
7048e2c567
commit
f8634e0757
@ -166,7 +166,10 @@
|
||||
* Render tab form fields once a lazy tab is selected.
|
||||
*/
|
||||
FormWidget.prototype.bindLazyTabs = function() {
|
||||
this.$el.on('click', '.tab-lazy [data-toggle="tab"]', function() {
|
||||
var tabControl = $('[data-control=tab]', this.$el),
|
||||
tabContainer = $('.nav-tabs', tabControl)
|
||||
|
||||
tabContainer.on('click', '.tab-lazy [data-toggle="tab"]', function() {
|
||||
var $el = $(this),
|
||||
handlerName = $el.data('tab-lazy-handler')
|
||||
|
||||
@ -191,6 +194,11 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// If initial active tab is lazy loaded, load it immediately
|
||||
if ($('> li.active.tab-lazy', tabContainer).length) {
|
||||
$('> li.active.tab-lazy > [data-toggle="tab"]', tabContainer).trigger('click')
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user