Replace "shield" hack in MWReferenceResultWidget with CSS

Same as in I7e82e03. The extra "shield" element was added in
2013 (!), see Ib244ff6. Back then we couldn't use the CSS property.
But nowadays we can.

Bug: T360034
Bug: T367030
Change-Id: Ib41e062491e65eabc8a52facefe283ba04ce16ff
This commit is contained in:
thiemowmde 2024-06-14 14:46:53 +02:00 committed by Thiemo Kreuz (WMDE)
parent f3d0c8643d
commit bc7f1a7005
3 changed files with 4 additions and 13 deletions

View file

@ -20,10 +20,7 @@ ve.ui.MWReferenceResultWidget = function VeUiMWReferenceResultWidget() {
// Initialization
this.$element
.addClass( 've-ui-mwReferenceResultWidget' )
.append(
$( '<div>' ).addClass( 've-ui-mwReferenceResultWidget-shield' )
);
.addClass( 've-ui-mwReferenceResultWidget' );
};
/* Inheritance */

View file

@ -16,13 +16,7 @@
&.oo-ui-labelElement .oo-ui-labelElement-label {
white-space: normal;
}
&-shield {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
// Disable click events in the preview
pointer-events: none;
}
}

View file

@ -5,5 +5,5 @@ QUnit.module( 've.ui.MWReferenceResultWidget (Cite)', ve.test.utils.newMwEnviron
QUnit.test( 'Initialization', ( assert ) => {
const widget = new ve.ui.MWReferenceResultWidget();
assert.true( widget instanceof OO.ui.OptionWidget );
assert.strictEqual( widget.$element.children( '.ve-ui-mwReferenceResultWidget-shield' ).length, 1 );
assert.strictEqual( widget.$element.children( '.ve-ui-mwReferenceResultWidget-shield' ).length, 0 );
} );