diff --git a/core/misc/dropbutton/dropbutton.js b/core/misc/dropbutton/dropbutton.js index 91fbfdd..4c48f72 100644 --- a/core/misc/dropbutton/dropbutton.js +++ b/core/misc/dropbutton/dropbutton.js @@ -27,17 +27,18 @@ */ function dropbuttonClickHandler(e) { e.preventDefault(); - // dropbutton object + // Dropbutton object. var $this = $(e.target).closest('.dropbutton-wrapper'); - // save offset parent, if element is absolute positioned, we need a relative position for calculation + // Save offset parent, if element is absolute positioned, we need a relative + // position for calculation. var $parent = $this.offsetParent(); - // forgot parent, if parent is the main HTML object + // Forgot parent, if parent is the main HTML object. if ($parent[0] == jQuery('html')[0]) { $parent = $this; } - // open the dropbutton + // Open the dropbutton. $this.toggleClass('open'); - - // calculate scrolling if opened dropbutton sticking out of viewport + + // Calculate scrolling if opened dropbutton sticking out of viewport. if ($parent.position()) { if ($parent.position().top + $this.height() > $(window).scrollTop() + (window.innerHeight)) { $('html, body').animate({