Selectmenu: CGL and lint fixes

This commit is contained in:
Felix Nagel 2012-12-15 02:40:14 +01:00
parent 1b1dbd8e3a
commit 76f335ea68

View File

@ -190,7 +190,8 @@ $.widget( "ui.selectmenu", {
return;
}
var _position = {
var currentItem,
_position = {
of: this.button
};
@ -198,8 +199,8 @@ $.widget( "ui.selectmenu", {
this._toggleAttr();
// do not change position if non default position options are set (needed for custom positioned popup menus)
if ( this.items && !this.options.dropdown && this.options.position.my == "left top" && this.options.position.at == "left bottom" ) {
var currentItem = this._getSelectedItem();
if ( this.items && !this.options.dropdown && this.options.position.my === "left top" && this.options.position.at === "left bottom" ) {
currentItem = this._getSelectedItem();
// center current item
if ( this.menu.outerHeight() < this.menu.prop( "scrollHeight" ) ) {
this.menuWrap.css( "left" , -10000 );