Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made it compatible with the changed Position API of jQuery UI 1.9 .

  • Loading branch information...
commit e0cc1e9ff0454b0f7ac4e8fd7f1e775f9e217d63 1 parent 6ff94ff
@lephyrius lephyrius authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 ui/jquery.ui.selectmenu.js
View
13 ui/jquery.ui.selectmenu.js
@@ -762,12 +762,18 @@ $.widget("ui.selectmenu", {
},
_refreshPosition: function() {
- var o = this.options;
+ var o = this.options, _my = o.positionOptions.my, split_my = _my.split(' ');
// if its a native pop-up we need to calculate the position of the selected li
if (o.style == "popup" && !o.positionOptions.offset) {
var selected = this._selectedOptionLi();
- var _offset = "0 -" + (selected.outerHeight() + selected.offset().top - this.list.offset().top);
+ _my = split_my[0] + " " + split_my[1] + '-' + (selected.outerHeight() + selected.offset().top - this.list.offset().top);
+ } else if (o.positionOptions.offset !== null) {
+ var off = o.positionOptions.offset.split(' ');
+ var off_x = parseInt(off[0]);
+ var off_y = parseInt(off[1]);
+ _my = split_my[0] + ((off_x <= 0)?'':'+') + off_x + " " + split_my[1] + ((off_y <= 0)?'':'+') + off_y;
}
+
this.list
.css({
zIndex: this.element.zIndex()
@@ -775,9 +781,8 @@ $.widget("ui.selectmenu", {
.position({
// set options for position plugin
of: o.positionOptions.of || this.newelement,
- my: o.positionOptions.my,
+ my: _my,
at: o.positionOptions.at,
- offset: o.positionOptions.offset || _offset
});
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.