Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only disable lazy infuse if using cloner fields #455

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions modules/ext.managewiki.oouiform.tabs.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
( function () {
$( function () {
// The lazy loading is temporarily disabled to prevent conflict with the cloner widget.
var autoinfuseLazy = false,
tabs, previousTab, switchingNoHash;
var tabs, previousTab, switchingNoHash;

tabs = OO.ui.infuse( $( '.managewiki-tabs' ) );

Expand All @@ -18,7 +16,8 @@
}
} );

if ( autoinfuseLazy && !panel.$element.data( 'mw-section-infused' ) ) {
// We disable lazy infuse if there is a cloner as lazy infuse causes cloner to add two fields each time rather than one.
if ( !panel.$element.find( '.mw-htmlform-field-HTMLFormFieldCloner' ).length && !panel.$element.data( 'mw-section-infused' ) ) {
panel.$element.removeClass( 'mw-htmlform-autoinfuse-lazy' );
mw.hook( 'htmlform.enhance' ).fire( panel.$element );
panel.$element.data( 'mw-section-infused', true );
Expand Down
Loading