From: Tyrell Cook Date: Sun, 26 Apr 2015 20:59:02 +0000 (-0400) Subject: CRM-16354 make sure init once X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4d49c3a29ea3859a2e59c87ca7de46a49ff71368;p=civicrm-core.git CRM-16354 make sure init once --- 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);