jquery.crmeditable.js - fix jshint warnings
authorColeman Watts <coleman@civicrm.org>
Sat, 7 Feb 2015 23:08:19 +0000 (18:08 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 7 Feb 2015 23:08:19 +0000 (18:08 -0500)
js/jquery/jquery.crmeditable.js

index 79fe3232b6b5e551ea6cd8b3915115b84843ea0c..2b0908fd1d8936ac16ed38a3a7201dd8248b5024 100644 (file)
@@ -1,5 +1,8 @@
 // https://civicrm.org/licensing
 (function($, _) {
+  "use strict";
+  /* jshint validthis: true */
+
   // TODO: We'll need a way to clear this cache if options are edited.
   // Maybe it should be stored in the CRM object so other parts of the app can use it.
   // Note that if we do move it, we should also change the format of option lists to our standard sequential arrays
       }
 
       function restoreContainer() {
-        errorMsg && errorMsg.close && errorMsg.close();
+        if (errorMsg && errorMsg.close) errorMsg.close();
         $i.removeClass('crm-editable-saving crm-editable-editing');
       }