mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 22:25:27 +00:00
45a1b3b423
Shortcut for print. Disabled by default and controlled by wgMinervaDownloadIcon Note that with lazy images enabled, images will not appear in the printed article. This can be easily addressed inside the onClick function in a later patchset with a few modifications to the Skin class. Currently the flag when enabled will show on all browsers. There are some open questions on the ticket about how we want to limit the feature. This shouldn't block review or merging. Bug: T177215 Change-Id: I49f1736870c743990b3fb9916247e07a597b2f59
32 lines
613 B
JavaScript
32 lines
613 B
JavaScript
( function ( M ) {
|
|
|
|
var msg = mw.msg,
|
|
Icon = M.require( 'mobile.startup/Icon' );
|
|
|
|
/**
|
|
* A download icon for triggering print functionality
|
|
* @class DownloadIcon
|
|
* @extends Icon
|
|
*
|
|
* @constructor
|
|
*/
|
|
function DownloadIcon() {
|
|
var options = {};
|
|
options.tagName = 'li';
|
|
options.title = msg( 'minerva-download' );
|
|
options.name = 'download';
|
|
Icon.call( this, options );
|
|
}
|
|
|
|
OO.mfExtend( DownloadIcon, Icon, {
|
|
onClick: function () {
|
|
window.print();
|
|
},
|
|
events: {
|
|
click: 'onClick'
|
|
}
|
|
} );
|
|
|
|
M.define( 'skins.minerva.scripts/DownloadIcon', DownloadIcon );
|
|
}( mw.mobileFrontend ) );
|