LLWiki正在建设中,欢迎加入我们

“MediaWiki:Mobile.js”的版本间差异

跳转到导航 跳转到搜索
删除477字节 、​ 2021年4月4日 (日) 03:51
撤销Bhsd讨论)的版本25147
(撤销Bhsd讨论)的版本25147)
标签撤销 移动版网页编辑 移动版编辑
mw.hook( 'wikipage.content' ).add(function( $content ) {
const $collapsibleContent = $content.find( '.mw-collapsible:not(.mw-made-collapsible)' ),
$sortableContent = $content.find( 'table.sortable' ),;
$hoverGallery = $content.find( '.mw-gallery-packed-hover ' ),
isTouch = matchMedia( '(hover: none)' ).matches;
/**
* @Function: 折叠
console.log('Hook: wikipage.content,开始执行表格排序');
mw.loader.using( 'jquery.tablesorter' ).then(function() { $sortableContent.tablesorter(); });
}
/**
* @Function: packed-hover模式的gallery将在触摸屏上替换为packed模式
* @Author: [[User:Bhsd]]
*/
if (isTouch && $hoverGallery.length) {
console.log('Hook: wikipage.content, 开始移除gallery的hover效果');
$hoverGallery.toggleClass( 'mw-gallery-packed-hover mw-gallery-packed' );
}
});
16,874

个编辑

导航菜单