瀏覽代碼

Fix undefined variables errors

Maxime Quandalle 9 年之前
父節點
當前提交
77069a36cd
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 5 2
      client/components/boards/boardBody.js
  2. 1 1
      client/lib/inlinedform.js

+ 5 - 2
client/components/boards/boardBody.js

@@ -163,8 +163,11 @@ Template.boardBody.onRendered(function() {
   // Disable drag-dropping while in multi-selection mode, or if the current user
   // is not a board member
   self.autorun(() => {
-    $(self.listsDom).sortable('option', 'disabled',
-      MultiSelection.isActive() || !userIsMember());
+    const $listDom = $(self.listsDom);
+    if ($listDom.data('sortable')) {
+      $(self.listsDom).sortable('option', 'disabled',
+        MultiSelection.isActive() || !userIsMember());
+    }
   });
 
   // If there is no data in the board (ie, no lists) we autofocus the list

+ 1 - 1
client/lib/inlinedform.js

@@ -29,7 +29,7 @@ InlinedForm = BlazeComponent.extendComponent({
   },
 
   open(evt) {
-    evt.preventDefault();
+    evt && evt.preventDefault();
 
     // Close currently opened form, if any
     EscapeActions.executeUpTo('inlinedForm');