From 0ef074c1a1414786dd4839e41d6b07bba2d434f0 Mon Sep 17 00:00:00 2001 From: benweet Date: Sun, 20 Oct 2013 14:55:01 +0100 Subject: [PATCH] Fixed document panel when opening sharing link --- public/res/extensions/documentPanel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/res/extensions/documentPanel.js b/public/res/extensions/documentPanel.js index adac4c27..ef7df29e 100644 --- a/public/res/extensions/documentPanel.js +++ b/public/res/extensions/documentPanel.js @@ -177,7 +177,8 @@ define([ filterFiles(''); // Scroll to the active file - panelContentElt.scrollTop += documentListElt.querySelector('.file.active').getBoundingClientRect().top - 120; + var activeElt = documentListElt.querySelector('.file.active'); + activeElt && (panelContentElt.scrollTop += activeElt.getBoundingClientRect().top - 120); } });