P5-1922 fix jslint warnings

This commit is contained in:
Ruslan Getmansky
2017-11-03 15:53:11 +02:00
parent 3e04bc68d9
commit 8ff2614047
20 changed files with 193 additions and 157 deletions
+14 -7
View File
@@ -1,13 +1,18 @@
'use strict';
/* globals $, fabric */
var config = require('./config');
/**
* Creates a text-button with text/settings provided.
* @param {String} text - text to be shown inside the button
* @param {string} id
* @param {string} text - text to be shown inside the button
* @param {Object} settings
* @param {bool} isActive
*/
function TextButton(id, text, settings, isActive) {
/* jshint unused:false */
fabric.Group.call(this);
var __active = isActive || false;
@@ -65,7 +70,15 @@ function TextButton(id, text, settings, isActive) {
return this.__active;
};
function toggleActiveStyle() {
/*jshint validthis: true */
_rect.setFill(_rectSettings[this.isActive() ? 'activeFill' : 'fill']);
_text.setFill(_textSettings[this.isActive() ? 'activeFill' : 'fill']);
this.setText(_textSettings[this.isActive() ? 'textActive' : 'text']);
}
function handleMouseDown(e) {
/*jshint validthis: true */
toggleActiveStyle.call(this);
_callback.call(this, e);
@@ -74,12 +87,6 @@ function TextButton(id, text, settings, isActive) {
}
}
function toggleActiveStyle() {
_rect.setFill(_rectSettings[this.isActive() ? 'activeFill' : 'fill']);
_text.setFill(_textSettings[this.isActive() ? 'activeFill' : 'fill']);
this.setText(_textSettings[this.isActive() ? 'textActive' : 'text']);
}
this.onClick = function(callback) {
_callback = callback || function() {};
this.on('mousedown', function (e) {