X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/bfdfacaea46413e3e32e4bdb3760fbe6f1ade25b..af0452ad29bec28c7095f144e11337e0972b7670:/platforma/static/js/main.js
diff --git a/platforma/static/js/main.js b/platforma/static/js/main.js
index c7e0af86..26c935e0 100644
--- a/platforma/static/js/main.js
+++ b/platforma/static/js/main.js
@@ -515,7 +515,7 @@ function html(element) {
etag.replaceWith(text);
xml2html({
xml: '',
- success: function(text) {
+ success: function(text) {
mtag = $('');
spoint.insertNode(mtag[0]);
mtag.replaceWith(text);
@@ -599,8 +599,14 @@ function html(element) {
function save(argument) {
var nodeName = $box.attr('x-node') || 'pe';
+ var insertedText = $('textarea', $overlay).val();
+
+ if ($origin.is('.motyw')) {
+ insertedText = insertedText.replace(/,\s*$/, '');
+ }
+
xml2html({
- xml: '<' + nodeName + '>' + $('textarea', $overlay).val() + '' + nodeName + '>',
+ xml: '<' + nodeName + '>' + insertedText + '' + nodeName + '>',
success: function(element) {
$box.html($(element).html());
$overlay.remove();