From 4d49c3a29ea3859a2e59c87ca7de46a49ff71368 Mon Sep 17 00:00:00 2001 From: Tyrell Cook Date: Sun, 26 Apr 2015 16:59:02 -0400 Subject: [PATCH] CRM-16354 make sure init once --- js/Common.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/js/Common.js b/js/Common.js index 1ce6ee921a..116d80679a 100644 --- a/js/Common.js +++ b/js/Common.js @@ -832,13 +832,16 @@ CRM.strings = CRM.strings || {}; $('form[data-warn-changes] :input', e.target).each(function() { $(this).data('crm-initial-value', $(this).is(':checkbox, :radio') ? $(this).prop('checked') : $(this).val()); }); - $('textarea.crm-wysiwyg', e.target).each(function() { - if ($(this).hasClass("collapsed")) { - CRM.wysiwyg.createPlain(this); - } else { - CRM.wysiwyg.create(this); - } - }); + $('textarea.crm-wysiwyg', e.target) + .not('.wysiwyg-enabled') + .addClass('wysiwyg-enabled') + .each(function() { + if ($(this).hasClass("collapsed")) { + CRM.wysiwyg.createPlain(this); + } else { + CRM.wysiwyg.create(this); + } + }); }) .on('dialogopen', function(e) { var $el = $(e.target); -- 2.25.1