mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-03 15:24:10 +01:00
Dev update: Use $.extend to copy arrays and objects for the state savings, as we don't want plug-ins to be able to muck around with the DataTables internals by mistake (even with the slice, the objects in the arrays maintain their references)
This commit is contained in:
parent
a4c7ac222a
commit
9809d71161
12
media/js/jquery.dataTables.js
vendored
12
media/js/jquery.dataTables.js
vendored
@ -4235,15 +4235,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Store the interesting variables */
|
/* Store the interesting variables */
|
||||||
var i, iLen;
|
var i, iLen, bInfinite=oSettings.oScroll.bInfinite;
|
||||||
var oState = {
|
var oState = {
|
||||||
"iCreate": new Date().getTime(),
|
"iCreate": new Date().getTime(),
|
||||||
"iStart": (oSettings.oScroll.bInfinite ? 0 : oSettings._iDisplayStart),
|
"iStart": (bInfinite ? 0 : oSettings._iDisplayStart),
|
||||||
"iEnd": (oSettings.oScroll.bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
"iEnd": (bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
||||||
"iLength": oSettings._iDisplayLength,
|
"iLength": oSettings._iDisplayLength,
|
||||||
"aaSorting": oSettings.aaSorting.slice(),
|
"aaSorting": $.extend( true, [], oSettings.aaSorting ),
|
||||||
"oSearch": oSettings.oPreviousSearch.sSearch,
|
"oSearch": $.extend( true, {}, oSettings.oPreviousSearch ),
|
||||||
"aoSearchCols": oSettings.aoPreSearchCols.slice(),
|
"aoSearchCols": $.extend( true, [], oSettings.aoPreSearchCols ),
|
||||||
"abVisCols": []
|
"abVisCols": []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,15 +13,15 @@ function _fnSaveState ( oSettings )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Store the interesting variables */
|
/* Store the interesting variables */
|
||||||
var i, iLen;
|
var i, iLen, bInfinite=oSettings.oScroll.bInfinite;
|
||||||
var oState = {
|
var oState = {
|
||||||
"iCreate": new Date().getTime(),
|
"iCreate": new Date().getTime(),
|
||||||
"iStart": (oSettings.oScroll.bInfinite ? 0 : oSettings._iDisplayStart),
|
"iStart": (bInfinite ? 0 : oSettings._iDisplayStart),
|
||||||
"iEnd": (oSettings.oScroll.bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
"iEnd": (bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
||||||
"iLength": oSettings._iDisplayLength,
|
"iLength": oSettings._iDisplayLength,
|
||||||
"aaSorting": oSettings.aaSorting.slice(),
|
"aaSorting": $.extend( true, [], oSettings.aaSorting ),
|
||||||
"oSearch": oSettings.oPreviousSearch.sSearch,
|
"oSearch": $.extend( true, {}, oSettings.oPreviousSearch ),
|
||||||
"aoSearchCols": oSettings.aoPreSearchCols.slice(),
|
"aoSearchCols": $.extend( true, [], oSettings.aoPreSearchCols ),
|
||||||
"abVisCols": []
|
"abVisCols": []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user