Anja Jentzsch has submitted this change and it was merged.
Change subject: (bug 44744) Site links table: Attaching table headers earlier
......................................................................
(bug 44744) Site links table: Attaching table headers earlier
Attach the headers before initializing a new (first) value in order to not have
the license
information tooltip appear in the wrong spot. (The new value's table row would
be shifted
after adding the headers.)
Change-Id: I22ca45f709af50847f8b48285d855e963ad4e933
---
M lib/resources/wikibase.ui.SiteLinksEditTool.js
1 file changed, 9 insertions(+), 6 deletions(-)
Approvals:
Anja Jentzsch: Verified; Looks good to me, approved
diff --git a/lib/resources/wikibase.ui.SiteLinksEditTool.js
b/lib/resources/wikibase.ui.SiteLinksEditTool.js
index 961d6bf..ed9b588 100644
--- a/lib/resources/wikibase.ui.SiteLinksEditTool.js
+++ b/lib/resources/wikibase.ui.SiteLinksEditTool.js
@@ -128,12 +128,11 @@
* @return {wb.ui.PropertyEditTool.EditableValue}
*/
enterNewValue: function( value ) {
- var newValue =
wb.ui.PropertyEditTool.prototype.enterNewValue.call(
- this, value, { prepend: true, displayRemoveButton:
false }
- );
-
- // this would be the first site link -> attach column headers
- if ( this._editableValues.length === 1 ) {
+ // Attach the headers before initializing the new value in
order to not have the license
+ // information tooltip appear in the wrong spot. (The new
value's table row would be shifted
+ // after adding the headers.)
+ if ( this._editableValues.length === 0 ) {
+ // This would be the first site link -> attach column
headers.
$( 'table.wb-sitelinks thead' ).append(
mw.template( 'wb-sitelinks-thead',
mw.message(
'wikibase-sitelinks-sitename-columnheading' ).escaped(),
@@ -143,6 +142,10 @@
);
}
+ var newValue =
wb.ui.PropertyEditTool.prototype.enterNewValue.call(
+ this, value, { prepend: true, displayRemoveButton:
false }
+ );
+
$( newValue ).on( 'afterStopEditing', function( event, save,
wasPending ) {
if ( save ) {
--
To view, visit https://gerrit.wikimedia.org/r/49634
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I22ca45f709af50847f8b48285d855e963ad4e933
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.21-wmf10
Gerrit-Owner: Anja Jentzsch <[email protected]>
Gerrit-Reviewer: Anja Jentzsch <[email protected]>
Gerrit-Reviewer: Henning Snater <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits