From ab07571f86986dadb5ab824444128619078e702c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 16 Dec 2020 16:03:19 +0100 Subject: [locations] Fix adding expert rows; tweak WOL/SD style some more --- modules-available/locations/clientscript.js | 8 +++---- .../locations/templates/ajax-opening-location.html | 28 ++++++++++++++-------- 2 files changed, 22 insertions(+), 14 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 +} diff --git a/modules-available/locations/templates/ajax-opening-location.html b/modules-available/locations/templates/ajax-opening-location.html index 9d4e6f98..c3a32fd1 100644 --- a/modules-available/locations/templates/ajax-opening-location.html +++ b/modules-available/locations/templates/ajax-opening-location.html @@ -95,7 +95,7 @@ -