Fixed save as a project not showing overwrite confirmation, no background color
This commit is contained in:
@ -36,7 +36,7 @@ $(document).ready(function() {
|
||||
var list = JSON.parse(localStorage.getItem('projects'));
|
||||
var index;
|
||||
if( list && list.some(function(a, i) { if( a.name == save['file name'] ) {index = i; return true} return false }) ) {
|
||||
if( confirm('A sketch with this name already exists. Do you want to overwrite ' + save['file name']) + '?' ) {
|
||||
if( confirm('A sketch with this name already exists. Do you want to overwrite ' + save['file name'] + '?') ) {
|
||||
console.log(index);
|
||||
list[index] = {
|
||||
name: save['file name'],
|
||||
@ -51,11 +51,13 @@ $(document).ready(function() {
|
||||
list ? list.push({
|
||||
name: save['file name'],
|
||||
data: data,
|
||||
points: window.points
|
||||
points: window.points,
|
||||
settings: settings
|
||||
}) : list = [{
|
||||
name: save['file name'],
|
||||
data: data,
|
||||
points: window.points
|
||||
points: window.points,
|
||||
settings: settings
|
||||
}];
|
||||
localStorage.setItem('projects', JSON.stringify(list));
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user