diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js index 9db8c8cfd..c44a0024d 100644 --- a/resources/ext.popups.core.js +++ b/resources/ext.popups.core.js @@ -91,6 +91,7 @@ */ mw.popups.removeTooltips = function ( $elements ) { $elements + .filter( '[title]:not([title=""])' ) .on( 'mouseenter focus', function () { $( this ) .data( 'title', $( this ).attr( 'title' ) ) @@ -146,9 +147,7 @@ * @method selectPopupElements */ mw.popups.selectPopupElements = function () { - var notSelector = ':not(' + mw.popups.IGNORE_CLASSES.join(', ') + ')'; - - return mw.popups.$content.find( 'a' + notSelector + ':not([title=""])' ); + return mw.popups.$content.find( 'a:not(' + mw.popups.IGNORE_CLASSES.join(', ') + ')' ); }; mw.hook( 'wikipage.content').add( function ( $content ) { diff --git a/resources/ext.popups.renderer.article.js b/resources/ext.popups.renderer.article.js index 0348533d8..c0da5525d 100644 --- a/resources/ext.popups.renderer.article.js +++ b/resources/ext.popups.renderer.article.js @@ -35,6 +35,10 @@ title = link.data( 'title' ), deferred = $.Deferred(); + if ( !title ) { + return deferred.reject().promise(); + } + mw.popups.render.currentRequest = mw.popups.api.get( { action: 'query', prop: 'extracts|pageimages|revisions|info',