mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
fixed jshint complaints
This commit is contained in:
parent
5666733f98
commit
a8394d22b1
@ -21,7 +21,7 @@ pskl.LocalStorageService = (function() {
|
||||
var persistToLocalStorageRequest_ = function() {
|
||||
// Persist to localStorage when drawing. We throttle localStorage accesses
|
||||
// for high frequency drawing (eg mousemove).
|
||||
if(localStorageThrottler_ != null) {
|
||||
if(localStorageThrottler_ !== null) {
|
||||
window.clearTimeout(localStorageThrottler_);
|
||||
}
|
||||
localStorageThrottler_ = window.setTimeout(function() {
|
||||
@ -34,30 +34,30 @@ pskl.LocalStorageService = (function() {
|
||||
* @private
|
||||
*/
|
||||
var persistToLocalStorage_ = function() {
|
||||
console.log('[LocalStorage service]: Snapshot stored')
|
||||
window.localStorage['snapShot'] = frameSheet_.serialize();
|
||||
console.log('[LocalStorage service]: Snapshot stored');
|
||||
window.localStorage.snapShot = frameSheet_.serialize();
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
var restoreFromLocalStorage_ = function() {
|
||||
frameSheet_.deserialize(window.localStorage['snapShot']);
|
||||
frameSheet_.deserialize(window.localStorage.snapShot);
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
var cleanLocalStorage_ = function() {
|
||||
console.log('[LocalStorage service]: Snapshot removed')
|
||||
delete window.localStorage['snapShot'];
|
||||
console.log('[LocalStorage service]: Snapshot removed');
|
||||
delete window.localStorage.snapShot;
|
||||
};
|
||||
|
||||
return {
|
||||
init: function(frameSheet) {
|
||||
|
||||
if(frameSheet == undefined) {
|
||||
throw "Bad LocalStorageService initialization: <undefined frameSheet>"
|
||||
if(frameSheet === undefined) {
|
||||
throw "Bad LocalStorageService initialization: <undefined frameSheet>";
|
||||
}
|
||||
frameSheet_ = frameSheet;
|
||||
|
||||
|
@ -77,7 +77,7 @@ pskl.Palette = (function() {
|
||||
} else {
|
||||
colorPicker[0].color.fromString(color);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
init: function(framesheet) {
|
||||
|
@ -20,16 +20,6 @@ pskl.ToolSelector = (function() {
|
||||
var currentSelectedTool = toolInstances.simplePen;
|
||||
var previousSelectedTool = toolInstances.simplePen;
|
||||
|
||||
var selectTool_ = function(tool) {
|
||||
var maincontainer = $("body");
|
||||
var previousSelectedToolClass = maincontainer.data("selected-tool-class");
|
||||
if(previousSelectedToolClass) {
|
||||
maincontainer.removeClass(previousSelectedToolClass);
|
||||
}
|
||||
maincontainer.addClass(toolBehavior.toolId);
|
||||
$("#drawing-canvas-container").data("selected-tool-class", toolBehavior.toolId);
|
||||
};
|
||||
|
||||
var activateToolOnStage_ = function(tool) {
|
||||
var stage = $("body");
|
||||
var previousSelectedToolClass = stage.data("selected-tool-class");
|
||||
@ -56,7 +46,7 @@ pskl.ToolSelector = (function() {
|
||||
|
||||
if(clickedTool.length) {
|
||||
for(var tool in toolInstances) {
|
||||
if (toolInstances[tool].toolId == clickedTool.data()["toolId"]) {
|
||||
if (toolInstances[tool].toolId == clickedTool.data().toolId) {
|
||||
selectTool_(toolInstances[tool]);
|
||||
|
||||
// Show tool as selected:
|
||||
|
@ -16,7 +16,7 @@ jQuery.namespace = function() {
|
||||
*
|
||||
* @require Constants
|
||||
*/
|
||||
(function(ns) { // namespace: pskl.utils
|
||||
(function() { // namespace: pskl.utils
|
||||
|
||||
var ns = $.namespace("pskl.utils");
|
||||
|
||||
@ -35,5 +35,5 @@ jQuery.namespace = function() {
|
||||
//prototypeskl.ToolBehavior.Eraser.prototype.constructor = pskl.ToolBehavior.Eraser;
|
||||
};
|
||||
|
||||
})()
|
||||
})();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user