diff -r adb907bba956 -r 4c7ab16e5845 client/js/save-once.js --- a/client/js/save-once.js Fri May 22 17:48:14 2015 +0200 +++ b/client/js/save-once.js Mon May 25 01:18:12 2015 +0200 @@ -20,13 +20,13 @@ url: _opts.url, data: getdata, beforeSend: function(){ - _proj.set({loading_status:true}); + _proj.set({loadingStatus:true}); }, success: function(_data) { _proj.set(_data, {validate: true}); - _proj.set({loading_status:false}); - _proj.set({save_status:0}); - _renkan.renderer.autoScale(); + _proj.set({loadingStatus:false}); + _proj.set({saveStatus:0}); + _renkan.renderer.autoScale(); } }); }; @@ -39,20 +39,20 @@ contentType: "application/json", data: JSON.stringify(_data), beforeSend: function(){ - _proj.set({save_status:2}); + _proj.set({saveStatus:2}); }, success: function(data, textStatus, jqXHR) { $(window).off("beforeunload", _onLeave); _saveWarn = false; - _proj.set({save_status:0}); + _proj.set({saveStatus:0}); //document.location.hash = "#id=" + data.id; //$(".Rk-Notifications").text("Saved as "+document.location.href).fadeIn().delay(2000).fadeOut(); } }); }; var _checkLeave = function() { - _proj.set({save_status:1}); - + _proj.set({saveStatus:1}); + var title = _proj.get("title"); if (title && _proj.get("nodes").length) { $(".Rk-Save-Button").removeClass("disabled"); @@ -70,11 +70,11 @@ _load(); _proj.on("add:nodes add:edges add:users change", function(_model) { _model.on("change remove", function(_model) { - if(!(_model.changedAttributes.length === 1 && _model.hasChanged('save_status'))) { + if(!(_model.changedAttributes.length === 1 && _model.hasChanged('saveStatus'))) { _checkLeave(); } }); - if(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('save_status'))) { + if(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('saveStatus'))) { _checkLeave(); } });