Fixed save as a project not showing overwrite confirmation, no background color

This commit is contained in:
Mahdi Dibaiee
2014-02-21 18:03:33 +03:30
parent 353aa1e410
commit 83a2b4d394
9 changed files with 30 additions and 14 deletions

View File

@ -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 {