https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38177

Jonathan Druart <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #173119|0                           |1
        is obsolete|                            |

--- Comment #16 from Jonathan Druart <[email protected]> ---
Created attachment 173121
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173121&action=edit
Bug 38177: Fix lengthMenu by removing extend

$.extend is doing a deep copy of the objects.

```
var dataTablesDefaults = { "lengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50,
100, __('All')]] };
var mine = {lengthMenu: [[1, 2, 5, 10], [1, 2, 5, 10]]};
$.extend(true, {}, dataTablesDefaults, mine);
```
Returns:
```
[
  1,
  2,
  5,
  10,
  -1
]
```
Which is ugly and not what we want.

We only need to merge the first level. Using the spread operator (...) will do
the trick here.

Note that we certainly want to adjust all the other occurrences of
extend for DT's options.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to