diff options
author | Simon Rettberg | 2020-12-16 16:03:19 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-12-16 16:03:19 +0100 |
commit | ab07571f86986dadb5ab824444128619078e702c (patch) | |
tree | 56f1441047de971dad61d9856cd4b42e36e23a7e /modules-available/locations/clientscript.js | |
parent | [locations] openingtimes: fix switch to expert mode (diff) | |
download | slx-admin-ab07571f86986dadb5ab824444128619078e702c.tar.gz slx-admin-ab07571f86986dadb5ab824444128619078e702c.tar.xz slx-admin-ab07571f86986dadb5ab824444128619078e702c.zip |
[locations] Fix adding expert rows; tweak WOL/SD style some more
Diffstat (limited to 'modules-available/locations/clientscript.js')
-rw-r--r-- | modules-available/locations/clientscript.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules-available/locations/clientscript.js b/modules-available/locations/clientscript.js index 89abcefc..9a434e04 100644 --- a/modules-available/locations/clientscript.js +++ b/modules-available/locations/clientscript.js @@ -37,8 +37,8 @@ var slxIdCounter = 0; /** * Adds a new opening time to the table in expert mode. */ -function newOpeningTime(vals) { - var $row = $('#expert-template').find('div.row').clone(); +function newOpeningTime($loc, vals) { + var $row = $loc.find('.expert-template div.row').clone(); if (vals['days'] && Array.isArray(vals['days'])) { for (var i = 0; i < allDays.length; ++i) { $row.find('.i-' + allDays[i]).prop('checked', vals['days'].indexOf(allDays[i]) !== -1); @@ -53,7 +53,7 @@ function newOpeningTime(vals) { }); $row.find('.i-openingtime').val(vals['openingtime']); $row.find('.i-closingtime').val(vals['closingtime']); - $('#expert-table').append($row); + $loc.find('.expert-table').append($row); return $row; } @@ -158,4 +158,4 @@ function validateOpeningTimes(event) { event.preventDefault(); } $form.find('input[name="openingtimes"]').val(JSON.stringify(schedule)); -}
\ No newline at end of file +} |