From 24661d9d67ca8d16dd94b4e2bb8ed7a81af324b2 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 6 Dec 2017 20:52:24 +0300 Subject: [PATCH] Fixed opening in the developer mode. --- apps/documenteditor/main/app/view/LeftMenu.js | 5 +++-- apps/presentationeditor/main/app/view/LeftMenu.js | 5 +++-- apps/spreadsheeteditor/main/app/view/LeftMenu.js | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 7862d7f9ff..fc9ea47ca0 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -367,8 +367,9 @@ define([ } this.developerHint.toggleClass('hidden', !mode); - var lastbtn = this.$el.find('button.btn-category:visible:last-of-type'); - this.minDevPosition = lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20; + var btns = this.$el.find('button.btn-category:visible'), + lastbtn = (btns.length>0) ? $(btns[btns.length-1]) : null; + this.minDevPosition = (lastbtn) ? (lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20) : 20; this.onWindowResize(); }, diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js index 7c35bbedbf..f4d2dbbc5d 100644 --- a/apps/presentationeditor/main/app/view/LeftMenu.js +++ b/apps/presentationeditor/main/app/view/LeftMenu.js @@ -364,8 +364,9 @@ define([ } this.developerHint.toggleClass('hidden', !mode); - var lastbtn = this.$el.find('button.btn-category:visible:last-of-type'); - this.minDevPosition = lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20; + var btns = this.$el.find('button.btn-category:visible'), + lastbtn = (btns.length>0) ? $(btns[btns.length-1]) : null; + this.minDevPosition = (lastbtn) ? (lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20) : 20; this.onWindowResize(); }, diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index 76a0ac8c6a..ab0df16730 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -336,8 +336,9 @@ define([ } this.developerHint.toggleClass('hidden', !mode); - var lastbtn = this.$el.find('button.btn-category:visible:last-of-type'); - this.minDevPosition = lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20; + var btns = this.$el.find('button.btn-category:visible'), + lastbtn = (btns.length>0) ? $(btns[btns.length-1]) : null; + this.minDevPosition = (lastbtn) ? (lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20) : 20; this.onWindowResize(); },