DEV formatting corrections to last edit

pull/428/head
Colin Marks 6 years ago
parent d6b5dc1729
commit 1cb1d80874

@ -47,7 +47,6 @@
* );
*/
(function(window, document, $, undefined) {
// Use DataTables' object builder so strings can be used to represent
// nested objects
var setBuilder = $.fn.dataTable.ext.internal._fnSetObjectDataFn;
@ -60,26 +59,22 @@ $.fn.dataTable.ext.deepLink = function(whitelist) {
var pair = search[i].split('=');
var key = decodeURIComponent(pair[0]);
var value = decodeURIComponent(pair[1]);
console.log("key: " + key);
console.log("value: " + value);
console.log('key: ' + key);
console.log('value: ' + value);
// "Casting"
if (value === 'true') {
value = true;
}
else if (value === 'false') {
} else if (value === 'false') {
value = false;
}
else if (!value.match(/[^\d]/) && key !== 'search.search') {
} else if (!value.match(/[^\d]/) && key !== 'search.search') {
// don't convert if searching or it'll break the search
value = value * 1;
}
else if (value.indexOf('{') === 0 || value.indexOf('[') === 0) {
} else if (value.indexOf('{') === 0 || value.indexOf('[') === 0) {
// Try to JSON parse for arrays and obejcts
try {
value = $.parseJSON(value);
}
catch(e){}
} catch (e) {}
}
if (whitelist === 'all' || $.inArray(key, whitelist) !== -1) {
@ -90,5 +85,4 @@ $.fn.dataTable.ext.deepLink = function(whitelist) {
return out;
};
})(window, document, jQuery);

Loading…
Cancel
Save