assets/js/romo/dropdown.js in romo-0.20.0 vs assets/js/romo/dropdown.js in romo-0.20.1

- old
+ new

@@ -62,15 +62,14 @@ // assumes popup height always greater than or equal to content height var contentMaxHeight = configHeight - (popupHeight - this.contentElem.offsetHeight); Romo.setStyle(this.contentElem, 'max-height', contentMaxHeight.toString() + 'px'); } - var elemRect = this.elem.getBoundingClientRect(); var elemOffset = Romo.offset(this.elem); - var elemHeight = elemRect.height; - var elemWidth = elemRect.width; + var elemHeight = Romo.height(this.elem); + var elemWidth = Romo.width(this.elem); var elemTop = elemOffset.top; var elemLeft = elemOffset.left var popupOffsetHeight = this.popupElem.offsetHeight; var popupOffsetWidth = this.popupElem.offsetWidth; @@ -156,13 +155,11 @@ this.elem, Romo.data(this.elem, 'romo-dropdown-append-to-closest') || 'body' ); Romo.append(popupParentElem, this.popupElem); - this.bodyElem = Romo.children(this.popupElem).find(Romo.proxy(function(childElem) { - return Romo.is(childElem, '.romo-dropdown-body'); - }, this)); + this.bodyElem = Romo.children(this.popupElem, '.romo-dropdown-body')[0]; if (Romo.data(this.elem, 'romo-dropdown-style-class') !== undefined) { Romo.addClass(this.bodyElem, Romo.data(this.elem, 'romo-dropdown-style-class')); } this.contentElem = undefined; @@ -225,10 +222,10 @@ if (Romo.data(this.elem, 'romo-dropdown-max-height') !== 'detect') { Romo.setStyle(this.contentElem, 'max-height', Romo.data(this.elem, 'romo-dropdown-max-height')); } if (Romo.data(this.elem, 'romo-dropdown-width') === 'elem') { - Romo.setStyle(this.popupElem, 'width', Romo.css(this.elem, 'width')); + Romo.setStyle(this.popupElem, 'width', Romo.width(this.elem)+'px'); } else { Romo.setStyle(this.contentElem, 'min-width', Romo.data(this.elem, 'romo-dropdown-min-width')); Romo.setStyle(this.contentElem, 'max-width', Romo.data(this.elem, 'romo-dropdown-max-width')); Romo.setStyle(this.contentElem, 'width', Romo.data(this.elem, 'romo-dropdown-width')); }