remove unecessary file + better error handling

This commit is contained in:
Martin Konecny 2013-02-15 14:19:04 -05:00
parent 39ec07e71c
commit 09baf3a47d
2 changed files with 18 additions and 1032 deletions

View File

@ -491,9 +491,11 @@ var AIRTIME = (function(AIRTIME) {
}, },
"fnStateLoad": function fnLibStateLoad(oSettings) { "fnStateLoad": function fnLibStateLoad(oSettings) {
var settings = localStorage.getItem('datatables-library'); var settings = localStorage.getItem('datatables-library');
if (settings !== "") { try {
return JSON.parse(settings); return JSON.parse(settings);
} catch (e) {
return null;
} }
}, },
"fnStateLoadParams": function (oSettings, oData) { "fnStateLoadParams": function (oSettings, oData) {
@ -501,18 +503,22 @@ var AIRTIME = (function(AIRTIME) {
length, length,
a = oData.abVisCols; a = oData.abVisCols;
// putting serialized data back into the correct js type to make if (a) {
// sure everything works properly. // putting serialized data back into the correct js type to make
for (i = 0, length = a.length; i < length; i++) { // sure everything works properly.
if (typeof(a[i]) === "string") { for (i = 0, length = a.length; i < length; i++) {
a[i] = (a[i] === "true") ? true : false; if (typeof(a[i]) === "string") {
} a[i] = (a[i] === "true") ? true : false;
}
}
} }
a = oData.ColReorder; a = oData.ColReorder;
for (i = 0, length = a.length; i < length; i++) { if (a) {
if (typeof(a[i]) === "string") { for (i = 0, length = a.length; i < length; i++) {
a[i] = parseInt(a[i], 10); if (typeof(a[i]) === "string") {
a[i] = parseInt(a[i], 10);
}
} }
} }