diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index e9edd1c018..e501a50dbb 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -678,8 +678,11 @@ define([ var tabEl = tab.$el; this.tabMenu.atposition = function () { + var parentEl = tabEl.parent(); + if (parentEl.length<1) return; + var rect = Common.Utils.getBoundingClientRect(tabEl.get(0)), - parentPos = Common.Utils.getOffset(tabEl.parent()); + parentPos = Common.Utils.getOffset(parentEl); return { top : rect.top, left: rect.left - parentPos.left - 2, @@ -700,7 +703,7 @@ define([ onTabMenuAfterShow: function (obj) { if (obj.atposition) { var pos = this.tabMenu.atposition(); - obj.setOffset(Common.UI.isRTL() ? (pos.right - $(obj.el).width()) : pos.left); + pos && obj.setOffset(Common.UI.isRTL() ? (pos.right - $(obj.el).width()) : pos.left); } this.enableKeyEvents = true;