Merge pull request #6528 from colemanw/Common
authorcolemanw <coleman@civicrm.org>
Tue, 18 Aug 2015 17:03:18 +0000 (13:03 -0400)
committercolemanw <coleman@civicrm.org>
Tue, 18 Aug 2015 17:03:18 +0000 (13:03 -0400)
JS cleanup

js/Common.js
js/wysiwyg/crm.ckeditor.js

index dcf7b18e3fcdc590d0004db8710965007f7f5cbe..405e6b483b55bf6414c0989d7f621b9faba8d4df 100644 (file)
@@ -201,8 +201,9 @@ function showHideRow(index) {
 
 /* jshint ignore:end */
 
-CRM.utils = CRM.utils || {};
-CRM.strings = CRM.strings || {};
+if (!CRM.utils) CRM.utils = {};
+if (!CRM.strings) CRM.strings = {};
+if (!CRM.vars) CRM.vars = {};
 
 (function ($, _, undefined) {
   "use strict";
@@ -944,8 +945,7 @@ CRM.strings = CRM.strings || {};
   $.fn.crmtooltip = function () {
     $(document)
       .on('mouseover', 'a.crm-summary-link:not(.crm-processed)', function (e) {
-        $(this).addClass('crm-processed');
-        $(this).addClass('crm-tooltip-active');
+        $(this).addClass('crm-processed crm-tooltip-active');
         var topDistance = e.pageY - $(window).scrollTop();
         if (topDistance < 300 || topDistance < $(this).children('.crm-tooltip-wrapper').height()) {
           $(this).addClass('crm-tooltip-down');
@@ -958,8 +958,7 @@ CRM.strings = CRM.strings || {};
         }
       })
       .on('mouseout', 'a.crm-summary-link', function () {
-        $(this).removeClass('crm-processed');
-        $(this).removeClass('crm-tooltip-active crm-tooltip-down');
+        $(this).removeClass('crm-processed crm-tooltip-active crm-tooltip-down');
       })
       .on('click', 'a.crm-summary-link', false);
   };
@@ -1314,15 +1313,6 @@ CRM.strings = CRM.strings || {};
       messagesFromMarkup.call($('#crm-container'));
     }
 
-    // Hide CiviCRM menubar when editor is fullscreen
-    if (window.CKEDITOR) {
-      CKEDITOR.on('instanceCreated', function (e) {
-        e.editor.on('maximize', function (e) {
-          $('#civicrm-menu').toggle(e.data === 2);
-        });
-      });
-    }
-
     $('body')
       // bind the event for image popup
       .on('click', 'a.crm-image-popup', function(e) {
index 5d418e57b39a93cb942ebf42eab332c54918e72c..18677de696489fefbcd164fa6e1eaaa1554dc992 100644 (file)
       editor.on('pasteState', function() {
         $(item).trigger("paste");
       });
+      // Hide CiviCRM menubar when editor is fullscreen
+      editor.on('maximize', function (e) {
+        $('#civicrm-menu').toggle(e.data === 2);
+      });
     }
   };
   CRM.wysiwyg.destroy = function(item) {