Bartosz Dziewoński has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/355642 )
Change subject: Unbreak usages of $.fn.makeCollapsible with custom `<a>` toggle
......................................................................
Unbreak usages of $.fn.makeCollapsible with custom `<a>` toggle
Change 2d95d36a8ed296813e686e9b756c2bb7c306950f in MediaWiki core has
made it so that a collapsible box is never expanded if the target of
the 'click' event is an `<a>` element. Our custom toggles are `<a>`
elements, so they all broke.
Work around the problem by wrapping the clickable contents of the
`<a>` toggles with a `<div>`, so that it becomes the event target.
Bug: T166298
Change-Id: I23ddf6de4c5ac01148446bb98344baadae063462
---
M resources/mw.UploadWizardDetails.js
M resources/mw.UploadWizardLicenseInput.js
M resources/uw.CopyMetadataWidget.js
3 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/42/355642/1
diff --git a/resources/mw.UploadWizardDetails.js
b/resources/mw.UploadWizardDetails.js
index 34d7a0a..ec0a254 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -159,7 +159,7 @@
$moreDetailsWrapperDiv
.append(
- $( '<a>' ).text( mw.msg(
'mwe-upwiz-more-options' ) )
+ $( '<a>' ).append( $( '<div>' ).text(
mw.msg( 'mwe-upwiz-more-options' ) ) )
.addClass(
'mwe-upwiz-details-more-options mw-collapsible-toggle mw-collapsible-arrow' ),
$moreDetailsDiv.addClass(
'mw-collapsible-content' )
)
diff --git a/resources/mw.UploadWizardLicenseInput.js
b/resources/mw.UploadWizardLicenseInput.js
index 246a6c2..ef8be38 100644
--- a/resources/mw.UploadWizardLicenseInput.js
+++ b/resources/mw.UploadWizardLicenseInput.js
@@ -148,7 +148,7 @@
// if there is a header, make a
toggle-to-expand div and append inputs there.
$head = $( '<a>' )
.addClass(
'mwe-upwiz-deed-license-group-head mw-collapsible-toggle mw-collapsible-arrow' )
- .msg( group.head, input.count );
+ .append( $( '<div>' ).msg(
group.head, input.count ) );
$body = $( '<div></div>' ).addClass(
'mwe-upwiz-deed-license-group-body mw-collapsible-content' );
$group.append( $head, $body
).makeCollapsible( { collapsed: true } );
}
diff --git a/resources/uw.CopyMetadataWidget.js
b/resources/uw.CopyMetadataWidget.js
index 6545ab3..3f71973 100644
--- a/resources/uw.CopyMetadataWidget.js
+++ b/resources/uw.CopyMetadataWidget.js
@@ -68,7 +68,7 @@
$copyMetadataWrapperDiv
.append(
- $( '<a>' ).text( mw.msg(
'mwe-upwiz-copy-metadata' ) )
+ $( '<a>' ).append( $( '<div>' ).text( mw.msg(
'mwe-upwiz-copy-metadata' ) ) )
.addClass(
'mwe-upwiz-details-copy-metadata mw-collapsible-toggle mw-collapsible-arrow' ),
$copyMetadataDiv.addClass(
'mw-collapsible-content' )
)
--
To view, visit https://gerrit.wikimedia.org/r/355642
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I23ddf6de4c5ac01148446bb98344baadae063462
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits