summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner/js
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/roomplanner/js')
-rw-r--r--modules-available/roomplanner/js/grid.js6
-rw-r--r--modules-available/roomplanner/js/init.js15
2 files changed, 15 insertions, 6 deletions
diff --git a/modules-available/roomplanner/js/grid.js b/modules-available/roomplanner/js/grid.js
index 2ba1c7a1..2cca26cd 100644
--- a/modules-available/roomplanner/js/grid.js
+++ b/modules-available/roomplanner/js/grid.js
@@ -19,8 +19,8 @@ if (!roomplanner) var roomplanner = {
cellsep: 4,
scale: 100,
room: {
- width: 1000,
- height: 1000
+ width: 33,
+ height: 33
}
},
selectFromServer: selectMachine,
@@ -412,7 +412,7 @@ $(document).ready(function(){
roomplanner.slider = $('#scaleslider').slider({
orientation: "horizontal",
range: "min",
- min: 50,
+ min: 40,
max: 150,
value: 100,
change: update,
diff --git a/modules-available/roomplanner/js/init.js b/modules-available/roomplanner/js/init.js
index 2ff45cee..67090cc2 100644
--- a/modules-available/roomplanner/js/init.js
+++ b/modules-available/roomplanner/js/init.js
@@ -2,8 +2,6 @@
function initRoomplanner() {
- console.log('initRoomplanner');
-
$('#drawarea').css('top',(-roomplanner.settings.scale*10)+'px');
$('#drawarea').css('left',(-roomplanner.settings.scale*10)+'px');
@@ -23,16 +21,27 @@ function initRoomplanner() {
});
$("#saveBtn").click(function() {
+ $('#saveBtn').prop('disabled', true);
+ $('#error-msg').hide();
+ $('#success-msg').hide();
+ $('#saving-msg').show();
+ var serializedCurrent = roomplanner.serialize();
$.post('?do=roomplanner&locationid=' + locationId,
- { token: TOKEN, action: 'save', serializedRoom: roomplanner.serialize() }
+ { token: TOKEN, action: 'save', serializedRoom: serializedCurrent }
).done(function ( data ) {
if (data.indexOf('SUCCESS') !== -1) {
window.close();
+ // If window.close() failed, we give some feedback and remember the state as saved
+ $('#success-msg').show();
+ plannerLoadState = serializedCurrent;
return;
}
$('#error-msg').text('Error: ' + data).show();
}).fail(function () {
$('#error-msg').text('AJAX save call failed').show();
+ }).always(function() {
+ $('#saveBtn').prop('disabled', false);
+ $('#saving-msg').hide();
});
});