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(); },