mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-02 14:24:11 +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 */
|
||||
var i, iLen;
|
||||
var i, iLen, bInfinite=oSettings.oScroll.bInfinite;
|
||||
var oState = {
|
||||
"iCreate": new Date().getTime(),
|
||||
"iStart": (oSettings.oScroll.bInfinite ? 0 : oSettings._iDisplayStart),
|
||||
"iEnd": (oSettings.oScroll.bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
||||
"iStart": (bInfinite ? 0 : oSettings._iDisplayStart),
|
||||
"iEnd": (bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
||||
"iLength": oSettings._iDisplayLength,
|
||||
"aaSorting": oSettings.aaSorting.slice(),
|
||||
"oSearch": oSettings.oPreviousSearch.sSearch,
|
||||
"aoSearchCols": oSettings.aoPreSearchCols.slice(),
|
||||
"aaSorting": $.extend( true, [], oSettings.aaSorting ),
|
||||
"oSearch": $.extend( true, {}, oSettings.oPreviousSearch ),
|
||||
"aoSearchCols": $.extend( true, [], oSettings.aoPreSearchCols ),
|
||||
"abVisCols": []
|
||||
};
|
||||
|
||||
|
@ -13,15 +13,15 @@ function _fnSaveState ( oSettings )
|
||||
}
|
||||
|
||||
/* Store the interesting variables */
|
||||
var i, iLen;
|
||||
var i, iLen, bInfinite=oSettings.oScroll.bInfinite;
|
||||
var oState = {
|
||||
"iCreate": new Date().getTime(),
|
||||
"iStart": (oSettings.oScroll.bInfinite ? 0 : oSettings._iDisplayStart),
|
||||
"iEnd": (oSettings.oScroll.bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
||||
"iStart": (bInfinite ? 0 : oSettings._iDisplayStart),
|
||||
"iEnd": (bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),
|
||||
"iLength": oSettings._iDisplayLength,
|
||||
"aaSorting": oSettings.aaSorting.slice(),
|
||||
"oSearch": oSettings.oPreviousSearch.sSearch,
|
||||
"aoSearchCols": oSettings.aoPreSearchCols.slice(),
|
||||
"aaSorting": $.extend( true, [], oSettings.aaSorting ),
|
||||
"oSearch": $.extend( true, {}, oSettings.oPreviousSearch ),
|
||||
"aoSearchCols": $.extend( true, [], oSettings.aoPreSearchCols ),
|
||||
"abVisCols": []
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user