Skip to content

Commit 53fa273

Browse files
committed
morebits: fix integration with Navigation Popups
- Remove obsolete code to integrate with navpopups via window.setupTooltips which is no longer exposed. - Fire the wikipage.content hook instead, which is handled by navpopups. This is only done for content of previews, as popups for other links in Twinkle dialogs are unnecessary. - Change base z-index of dialog to 500. As popups uses 1000, this ensures that popups always appear over the dialog. Fixes #2307
1 parent 46bfd7a commit 53fa273

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/morebits.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4680,6 +4680,9 @@ Morebits.wiki.Preview = function(previewbox) {
46804680

46814681
// this makes links open in new tab
46824682
$(previewbox).find('a').attr('target', '_blank');
4683+
4684+
// Integrate with scripts that do things on rendered content, like navpopups
4685+
mw.hook('wikipage.content').fire($(previewbox));
46834686
};
46844687

46854688
/** Hides the preview box and clears it. */
@@ -5685,6 +5688,7 @@ Morebits.SimpleWindow = function SimpleWindow(width, height) {
56855688
// the 20 pixels represents adjustment for the extra height of the jQuery dialog "chrome", compared
56865689
// to that of the old SimpleWindow
56875690
height: height + 20,
5691+
zIndex: 500,
56885692
close: function(event) {
56895693
// dialogs and their content can be destroyed once closed
56905694
$(event.target).dialog('destroy').remove();
@@ -5774,11 +5778,7 @@ Morebits.SimpleWindow.prototype = {
57745778
$widget.find('.ui-dialog-title').prepend(scriptnamespan);
57755779
}
57765780

5777-
const dialog = $(this.content).dialog('open');
5778-
if (window.setupTooltips && window.pg && window.pg.re && window.pg.re.diff) { // tie in with NAVPOP
5779-
dialog.parent()[0].ranSetupTooltipsAlready = false;
5780-
window.setupTooltips(dialog.parent()[0]);
5781-
}
5781+
$(this.content).dialog('open');
57825782
this.setHeight(this.height); // init height algorithm
57835783
return this;
57845784
},

0 commit comments

Comments
 (0)