Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 314: Line 314:


$(document).on('click', '.wizlords-culture-card', function (event) {
$(document).on('click', '.wizlords-culture-card', function (event) {
var isCultureHeaderLink = $(event.target).closest('.wizlords-culture-card-header a, .wizlords-culture-card-title a').length;
if (isMobileCitizenCultureLayout() && isCultureHeaderLink) {
event.preventDefault();
event.stopPropagation();
toggleCultureCard(this);
return;
}
if ($(event.target).closest('a').length) {
if ($(event.target).closest('a').length) {
return;
return;
Line 327: Line 336:
}
}
});
});
}() );
/* Responsive race Available Classes lists */
( function () {
function initialiseRaceAvailableClassLists() {
$('.wizlords-culture-classes + ul, .wizlords-shared-classes ul').each(function () {
var $list = $(this);
var itemCount = $list.children('li').length;
var $sharedClasses = $list.closest('.wizlords-shared-classes');
var isDrakelingList = $sharedClasses
.children('.wizlords-shared-classes-title')
.first()
.text()
.indexOf('Drakelings') !== -1;
$list
.removeClass(function (index, className) {
return (className.match(/(^|\s)count-\d+/g) || []).join(' ');
})
.addClass('wizlords-available-classes-list count-' + itemCount)
.toggleClass('is-multicolumn', itemCount > 4)
.toggleClass('is-short', itemCount <= 4)
.toggleClass('is-drakeling-list', isDrakelingList);
$list
.closest('.wizlords-culture-card-body, .wizlords-shared-classes')
.addClass('wizlords-available-classes');
});
}
$(initialiseRaceAvailableClassLists);
}() );
}() );