X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/b993aa15c106eadf473fd64edbb9f3d9ddb7754a..70f40902039374237390366dd06319fed5c45ee7:/project/static/js/editor.js diff --git a/project/static/js/editor.js b/project/static/js/editor.js index 3b750cab..6e63eb08 100644 --- a/project/static/js/editor.js +++ b/project/static/js/editor.js @@ -51,6 +51,7 @@ Panel.prototype.load = function (url) { }, error: function(request, textStatus, errorThrown) { $.log('ajax', url, this.target, 'error:', textStatus, errorThrown); + $(self.contentDiv).html("

Wystapił błąd podczas wczytywania panelu."); } }); } @@ -206,7 +207,7 @@ Editor.prototype.saveToBranch = function(msg) var self = this; $.log('Saving to local branch - panel:', changed_panel); - if(!msg) msg = "Zapis z edytora platformy."; + if(!msg) msg = "Zapis z edytora platformy."; if( changed_panel.length == 0) { $.log('Nothing to save.'); @@ -219,7 +220,13 @@ Editor.prototype.saveToBranch = function(msg) } saveInfo = changed_panel.data('ctrl').saveInfo(); - $.extend(saveInfo.postData, {'commit_message': msg}); + var postData = '' + if(saveInfo.postData instanceof Object) + postData = $.param(saveInfo.postData); + else + postData = saveInfo.postData; + + postData += '&' + $.param({'commit_message': msg}) $.ajax({ url: saveInfo.url, @@ -241,7 +248,7 @@ Editor.prototype.saveToBranch = function(msg) self.showPopup('save-error'); }, type: 'POST', - data: saveInfo.postData + data: postData }); return true;