Bläddra i källkod

HUE-7525 [home] Prevent js error when dragging to select documents

Johan Ahlen 8 år sedan
förälder
incheckning
c87aa7e
1 ändrade filer med 7 tillägg och 5 borttagningar
  1. 7 5
      desktop/core/src/desktop/templates/document_browser.mako

+ 7 - 5
desktop/core/src/desktop/templates/document_browser.mako

@@ -693,11 +693,13 @@ from desktop.views import _ko
                 allRows.each(function (idx, row) {
                   var boundingRect = row.getBoundingClientRect();
                   var boundObject = ko.dataFor(row);
-                  if ((dragStartY <= boundingRect.top && event.clientY >= boundingRect.top) ||
-                      (event.clientY <= boundingRect.bottom && dragStartY >= boundingRect.bottom)) {
-                    boundObject.selected(true);
-                  } else if (!boundObject.alreadySelected) {
-                    boundObject.selected(false);
+                  if (boundObject) {
+                    if ((dragStartY <= boundingRect.top && event.clientY >= boundingRect.top) ||
+                        (event.clientY <= boundingRect.bottom && dragStartY >= boundingRect.bottom)) {
+                      boundObject.selected(true);
+                    } else if (!boundObject.alreadySelected) {
+                      boundObject.selected(false);
+                    }
                   }
                 });
                 $('.doc-browser-drag-select').css({