mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 06:13:54 +00:00
Disable "page issues" feature when DiscussionTools is handling talk page
Bug: T312309 Change-Id: I9c3035c9dbe7545a05efb2286dffe0145d3557b4
This commit is contained in:
parent
c5976996d9
commit
f876accf9a
|
@ -24,6 +24,7 @@ module.exports = function () {
|
|||
references = require( './references.js' ),
|
||||
TitleUtil = require( './TitleUtil.js' ),
|
||||
issues = require( './page-issues/index.js' ),
|
||||
talk = require( './talk.js' ),
|
||||
Toolbar = require( './Toolbar.js' ),
|
||||
ToggleList = require( '../../includes/Skins/ToggleList/ToggleList.js' ),
|
||||
TabScroll = require( './TabScroll.js' ),
|
||||
|
@ -404,7 +405,10 @@ module.exports = function () {
|
|||
TabScroll.initTabsScrollPosition();
|
||||
// Setup the issues banner on the page
|
||||
// Pages which dont exist (id 0) cannot have issues
|
||||
if ( !currentPage.isMissing ) {
|
||||
if (
|
||||
!currentPage.isMissing &&
|
||||
( !currentPage.titleObj.isTalkPage() || talk.isSimplifiedViewEnabled() )
|
||||
) {
|
||||
issues.init( overlayManager, currentPageHTMLParser );
|
||||
}
|
||||
|
||||
|
@ -429,7 +433,7 @@ module.exports = function () {
|
|||
|
||||
// wire up talk icon if necessary
|
||||
if ( permissions.talk ) {
|
||||
require( './talk.js' )( mobile );
|
||||
talk.init( mobile );
|
||||
}
|
||||
|
||||
// wire up watch icon if necessary
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
var SKIN_MINERVA_TALK_SIMPLIFIED_CLASS = 'skin-minerva--talk-simplified';
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
function isSimplifiedViewEnabled() {
|
||||
// eslint-disable-next-line no-jquery/no-class-state
|
||||
return $( document.body ).hasClass( SKIN_MINERVA_TALK_SIMPLIFIED_CLASS );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} mobile mobileFrontend component library
|
||||
*/
|
||||
module.exports = function ( mobile ) {
|
||||
function init( mobile ) {
|
||||
var
|
||||
SKIN_MINERVA_TALK_SIMPLIFIED_CLASS = 'skin-minerva--talk-simplified',
|
||||
toast = mobile.toast,
|
||||
currentPage = mobile.currentPage(),
|
||||
api = new mw.Api(),
|
||||
|
@ -168,20 +177,12 @@ module.exports = function ( mobile ) {
|
|||
.appendTo( '#content' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
function isSimplifiedViewEnabled() {
|
||||
// eslint-disable-next-line no-jquery/no-class-state
|
||||
return $( document.body ).hasClass( SKIN_MINERVA_TALK_SIMPLIFIED_CLASS );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up necessary event handlers related to the talk page and talk buttons.
|
||||
* Also renders the "Read as wikipage" button for the simplified mode
|
||||
* (T230695).
|
||||
*/
|
||||
function init() {
|
||||
function doInit() {
|
||||
var promise,
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
$addTalk = $( '.minerva-talk-add-button' );
|
||||
|
@ -211,6 +212,11 @@ module.exports = function ( mobile ) {
|
|||
}
|
||||
|
||||
if ( talkTitle ) {
|
||||
init();
|
||||
doInit();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: init,
|
||||
isSimplifiedViewEnabled: isSimplifiedViewEnabled
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue