P5-1922 fix jslint warnings
This commit is contained in:
+14
-7
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user