Fixed opening in the developer mode.

This commit is contained in:
Julia Radzhabova 2017-12-06 20:52:24 +03:00
parent 62e722ca60
commit 24661d9d67
3 changed files with 9 additions and 6 deletions

View file

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

View file

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

View file

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