From af0452ad29bec28c7095f144e11337e0972b7670 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Mon, 8 Mar 2010 14:20:16 +0100 Subject: [PATCH] Added auto-removal of commas in theme edit box, if there was only 1 theme netered. Fixes #270 --- platforma/static/js/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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() + '', + xml: '<' + nodeName + '>' + insertedText + '', success: function(element) { $box.html($(element).html()); $overlay.remove(); -- 2.20.1