All files / mobile.init fakeToolbar.js

100% Statements 6/6
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311x     1x     1x     1x             1x                       1x    
const icons = require( '../mobile.startup/icons' );
 
/* global $ */
module.exports = function fakeToolbar() {
	var $fakeToolbar, $goBack, $loadingMessage;
 
	$goBack = icons.cancel().$el;
 
	// FIXME: Should not be a button, instead should be an icon with text
	$loadingMessage = icons.spinner( {
		tagName: 'span',
		isIconOnly: false,
		label: mw.msg( 'mobile-frontend-editor-loading' )
	} ).$el;
 
	// Wrappers similar to .overlay-header-container, .overlay-header and .oo-ui-toolbar
	$fakeToolbar = $( '<div>' )
		.addClass( 've-mobile-fakeToolbar-container' )
		.append( $( '<div>' )
			.addClass( 've-mobile-fakeToolbar-header' )
			// Minerva has some complicated styling for this class, so we have to include it
			.addClass( 'overlay-header' )
			.append( $( '<div>' )
				.addClass( 've-mobile-fakeToolbar' )
				.append( $goBack, $loadingMessage )
			)
		);
 
	return $fakeToolbar;
};