[TASK] Remove local storage test
This commit is contained in:
parent
cd60af97c8
commit
df9facb3f6
@ -38,10 +38,6 @@ define(['d3', 'helper'], function (d3, helper) {
|
||||
}
|
||||
|
||||
function savePositions() {
|
||||
if (!helper.localStorageTest()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var save = intNodes.map(function (d) {
|
||||
return { id: d.o.id, x: d.x, y: d.y };
|
||||
});
|
||||
@ -721,7 +717,6 @@ define(['d3', 'helper'], function (d3, helper) {
|
||||
return !d.o.node;
|
||||
});
|
||||
|
||||
if (helper.localStorageTest()) {
|
||||
var save = JSON.parse(localStorage.getItem('graph/nodeposition'));
|
||||
|
||||
if (save) {
|
||||
@ -737,7 +732,6 @@ define(['d3', 'helper'], function (d3, helper) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var diameter = graphDiameter(intNodes);
|
||||
|
||||
|
@ -66,17 +66,6 @@ define({
|
||||
return this.dictGet(dict[k], key);
|
||||
},
|
||||
|
||||
localStorageTest: function localStorageTest() {
|
||||
var test = 'test';
|
||||
try {
|
||||
localStorage.setItem(test, test);
|
||||
localStorage.removeItem(test);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
listReplace: function listReplace(s, subst) {
|
||||
for (var key in subst) {
|
||||
var re = new RegExp(key, 'g');
|
||||
|
Loading…
Reference in New Issue
Block a user