Hygiene: remove unused downloadPageAction argument

Remove unused Skin parameter from downloadPageAction.

Change-Id: I27cd85b1e4f2328d3d4fd0ece5580c4432181757
This commit is contained in:
Stephen Niedzielski 2019-04-10 14:23:58 -06:00
parent effda33eab
commit cbea4fabd5
2 changed files with 9 additions and 25 deletions

View file

@ -65,11 +65,10 @@
}
/**
* onClick handler for button that invokes print function
* @param {Skin} skin
* @param {Icon} icon
* @param {Icon} spinner
*/
function onClick( skin, icon, spinner ) {
function onClick( icon, spinner ) {
function doPrint() {
icon.timeout = clearTimeout( icon.timeout );
track( 'minerva.downloadAsPDF', {
@ -105,13 +104,12 @@
* Gets a click handler for the download icon
* Expects to be run in the context of an icon using `Function.bind`
*
* @param {Skin} skin
* @param {Icon} spinner
* @returns {function}
*/
function getOnClickHandler( skin, spinner ) {
function getOnClickHandler( spinner ) {
return function () {
onClick( skin, this, spinner );
onClick( this, spinner );
};
}
@ -140,7 +138,7 @@
tagName: 'button',
events: {
// will be bound to `this`
click: getOnClickHandler( skin, spinner )
click: getOnClickHandler( spinner )
}
} );

View file

@ -2,7 +2,6 @@
var VALID_UA = 'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Mobile Safari/537.36',
VALID_SUPPORTED_NAMESPACES = [ 0 ],
mobile = M.require( 'mobile.startup' ),
Skin = mobile.Skin,
icons = mobile.icons,
Deferred = $.Deferred,
windowChrome = { chrome: true },
@ -16,20 +15,14 @@
QUnit.module( 'Minerva DownloadIcon', {
beforeEach: function () {
this.skin = new Skin( {
eventBus: {
on: function () {},
off: function () {}
}
} );
this.getOnClickHandler = function ( skin ) {
return getOnClickHandler( skin, icons.spinner() ).bind( downloadIcon );
this.getOnClickHandler = function () {
return getOnClickHandler( icons.spinner() ).bind( downloadIcon );
};
}
} );
QUnit.test( '#getOnClickHandler (print after image download)', function ( assert ) {
var handler = this.getOnClickHandler( this.skin ),
var handler = this.getOnClickHandler(),
d = Deferred(),
spy = this.sandbox.stub( window, 'print' );
@ -45,7 +38,7 @@
} );
QUnit.test( '#getOnClickHandler (print via timeout)', function ( assert ) {
var handler = this.getOnClickHandler( this.skin ),
var handler = this.getOnClickHandler(),
d = Deferred(),
spy = this.sandbox.stub( window, 'print' );
@ -66,7 +59,7 @@
} );
QUnit.test( '#getOnClickHandler (multiple clicks)', function ( assert ) {
var handler = this.getOnClickHandler( this.skin ),
var handler = this.getOnClickHandler(),
d = Deferred(),
spy = this.sandbox.stub( window, 'print' );
@ -95,13 +88,6 @@
isMainPage: false
} );
this.page = page;
this.skin = new Skin( {
eventBus: {
on: function () {},
off: function () {}
},
page: page
} );
this.isAvailable = function ( ua ) {
return isAvailable( windowChrome, page, ua,
VALID_SUPPORTED_NAMESPACES );