diff options
author | Simon Rettberg | 2017-06-12 17:00:45 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-06-12 17:00:45 +0200 |
commit | a9728379f3c796ef4f2fdddb8211febf3d5399d9 (patch) | |
tree | 6a31d35f1d01d5f77614cd9a4c6922181a45ebd0 /modules-available/locationinfo/clientscript.js | |
parent | [locationinfo] Started rewrite for panel-based approach (diff) | |
download | slx-admin-a9728379f3c796ef4f2fdddb8211febf3d5399d9.tar.gz slx-admin-a9728379f3c796ef4f2fdddb8211febf3d5399d9.tar.xz slx-admin-a9728379f3c796ef4f2fdddb8211febf3d5399d9.zip |
[locationinfo] Location edit part done so far
Diffstat (limited to 'modules-available/locationinfo/clientscript.js')
-rw-r--r-- | modules-available/locationinfo/clientscript.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules-available/locationinfo/clientscript.js b/modules-available/locationinfo/clientscript.js index b18cc5bd..a2a8ee1f 100644 --- a/modules-available/locationinfo/clientscript.js +++ b/modules-available/locationinfo/clientscript.js @@ -113,6 +113,12 @@ function submitLocationSettings(event) { 'openingtime': $t.find('.i-openingtime').val(), 'closingtime': $t.find('.i-closingtime').val() }; + for (var i = 0; i < allDays.length; ++i) { + if ($t.find('.i-' + allDays[i]).is(':checked')) { + entry['days'].push(allDays[i]); + } + } + if (entry.openingtime.length === 0 && entry.closingtime.length === 0 && entry.days.length === 0) return; // Also ignore empty lines s = getTime(entry.openingtime); e = getTime(entry.closingtime); if (s === false) { @@ -123,16 +129,11 @@ function submitLocationSettings(event) { $t.find('.i-closingtime').addClass('red-bg'); badFormat = true; } - if (badFormat) return; - for (var i = 0; i < allDays.length; ++i) { - if ($t.find('.i-' + allDays[i]).is(':checked')) { - entry['days'].push(allDays[i]); - } - } if (entry.days.length === 0) { $t.find('.days-box').addClass('red-bg'); badFormat = true; } + if (badFormat) return; schedule.push(entry); }); } |