Commit 77b14a4d32a9498fa61f7ede8196b03e8971c7df

Add white overlay while saving

  Fix UI issues like displaying a overlay while saving etc.
  
5757 width: 500px;
5858 z-index: 100;
5959 margin: 5px auto;
60 position: absolute;
61 left: 33%;
62 top: 0px;
6063}
6164#code-edit {
6265 position: absolute;
6868 bottom: 0 ;
6969 left: 125px;
7070 width: 70%;
71}
72#editor-overlay {
73 position: absolute;
74 width: 100%;
75 height: 100%;
76 background-color: #FFFFFF;
77 opacity: 0.7;
78 display: none;
7179}
  
5959 //console.log('remove', id);
6060 M.pages.get(id).destroy({
6161 success: function(model, response) {
62 M.editor.hideOverlay();
6263 //console.log('deleted', model, response);
6364 M.pages.remove(id);
6465 M.pagelistview.render();
7272 }));
7373 },
7474 error: function(model, xhr) {
75 M.editor.hideOverlay();
7576 console.log('failed', model, xhr);
7677 $('#notifications').html(fail_template({
7778 title: 'Error',
8080 }));
8181 }
8282 });
83 M.editor.showOverlay();
8384 },
8485 showMenu: function(event) {
8586 this.menuconfigview.render();
243243 this.model.save({}, {
244244 success: function(model, response) {
245245 //console.log('saved', model, response);
246 M.editor.hideOverlay();
246247 model.set(response.page);
247248 model.id = response.page.id;
248249 M.pagelistview.render();
253253 }));
254254 },
255255 error: function(model, xhr) {
256 M.editor.hideOverlay();
257 model.set(response.page);
256258 console.log('failed', model, xhr);
257259 $('#notifications').html(fail_template({
258260 title: 'Error!',
262262 }));
263263 }
264264 });
265 M.editor.showOverlay();
265266 return false;
266267 }
267268 });
462462 this.model.save({}, {
463463 success: function(model, response) {
464464 //console.log(model, response);
465 M.editor.hideOverlay();
465466 $('#notifications').html(success_template({
466467 title: 'Saved',
467468 msg: ''
470470
471471 },
472472 error: function(xhr, response) {
473 M.editor.hideOverlay();
473474 $('#notifications').html(fail_template({
474475 title: 'Error!',
475476 msg: 'Something went wrong, and the page could not be updated'
478478 }
479479 });
480480 //alert('end of save menu');
481 M.editor.showOverlay();
481482 }
482483 });
483484
485
484486 M.editor = {
485487 init: function() {
486488 M.pages = new Pages(M.site_content.content);
540540 },
541541 cleanUp: function(id) {
542542 }
543 },
544 showOverlay: function() {
545 $('#editor-overlay').show();
546 },
547 hideOverlay: function() {
548 $('#editor-overlay').hide();
543549 }
544550 };
545551
  
1313 </div>
1414 <div id="notifications"></div>
1515 </div>
16 <div id="content-container">
17 </div>
18 <div id="footer">
19 </div>
16 <div id="content-container"></div>
17 <div id="footer"></div>
2018 </div>
19 <div id="editor-overlay"></div>
2120
2221 <script>
2322 // initialize editor