From aec885b9630c1d2e2ed921b9234cab0e68815e54 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sun, 26 Jun 2016 03:49:21 +0200 Subject: [PATCH] frio: fix - jot default was not removed in every case while inserting content --- view/theme/frio/js/textedit.js | 2 -- view/theme/frio/templates/jot-header.tpl | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/view/theme/frio/js/textedit.js b/view/theme/frio/js/textedit.js index 40b49685a7..0b3db0571f 100644 --- a/view/theme/frio/js/textedit.js +++ b/view/theme/frio/js/textedit.js @@ -191,5 +191,3 @@ function dropItem(url, object) { }); } } - - \ No newline at end of file diff --git a/view/theme/frio/templates/jot-header.tpl b/view/theme/frio/templates/jot-header.tpl index 6d48145118..dc4bf32fc5 100644 --- a/view/theme/frio/templates/jot-header.tpl +++ b/view/theme/frio/templates/jot-header.tpl @@ -143,10 +143,14 @@ function enableOnUser(){ $(document).ready(function() { /* enable tinymce on focus and click */ - $("#profile-jot-text").focus(enableOnUser); - $("#profile-jot-text").click(enableOnUser); - + //$("#profile-jot-text").focus(enableOnUser); + //$("#profile-jot-text").click(enableOnUser); + // When clicking on a forum in acl we should remove the profile jot textarea + // default value before inserting the forum mention + $("body").on('click', '#jot-modal .acl-list-item.forum', function(){ + jotTextOpenUI(document.getElementById("profile-jot-text")); + }); /* show images / file browser window @@ -376,8 +380,14 @@ function enableOnUser(){ function addeditortext(data) { if(plaintext == 'none') { + // get the textfield + var textfield = document.getElementById("profile-jot-text"); + // check if the textfield does have the default-value + jotTextOpenUI(textfield); + // save already existent content var currentText = $("#profile-jot-text").val(); - $("#profile-jot-text").val(currentText + data); + //insert the data as new value + textfield.value = currentText + data; } else tinyMCE.execCommand('mceInsertRawHTML',false,data); @@ -426,5 +436,6 @@ function enableOnUser(){ $(function() {Dialog.showJot();}); } + -- 2.39.5