X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/7a12b550f4a8366c8ace2f9c55706aba7c4b17f7..f8dc1e5b5062456deab01f927e82b753202f31e3:/platforma/static/js/models.js?ds=sidebyside diff --git a/platforma/static/js/models.js b/platforma/static/js/models.js index ffaf999a..ba2f3ce3 100755 --- a/platforma/static/js/models.js +++ b/platforma/static/js/models.js @@ -262,7 +262,7 @@ Editor.HTMLModel = Editor.Model.extend({ }); }, - putXMLPart: function(elem, data) { + putXMLPart: function(elem, data, callback) { var self = this; var path = elem.attr('x-pointer'); @@ -281,7 +281,7 @@ Editor.HTMLModel = Editor.Model.extend({ // format: 'nl' }, success: function(htmldata) { - elem.html(htmldata); + callback(elem, htmldata); self.set('state', 'dirty'); } }); @@ -596,10 +596,13 @@ Editor.DocumentModel = Editor.Model.extend({ mergeCompleted: function(xhr, textStatus) { console.log(xhr.status, xhr.responseText); var response = parseXHRResponse(xhr); - if(response.success) - { - if( (response.data.result == 'no-op') - || (response.data.shared_timestamp == response.data.shared_parent_timestamp)) + + if(response.success) { + + if( (response.data.result == 'no-op') || + ( response.data.shared_parent_timestamp + && response.data.shared_timestamp + && (response.data.shared_timestamp == response.data.shared_parent_timestamp)) ) { if( (response.data.revision) && (response.data.revision != this.get('revision')) ) {