|
146 | 146 | } |
147 | 147 |
|
148 | 148 | function getSideBorderPadding(element) { |
149 | | - return element.outerWidth() - element.width(); |
| 149 | + return element.outerWidth(false) - element.width(); |
150 | 150 | } |
151 | 151 |
|
152 | 152 | function installKeyUpChangeEvent(element) { |
|
875 | 875 | // abstract |
876 | 876 | positionDropdown: function() { |
877 | 877 | var offset = this.container.offset(), |
878 | | - height = this.container.outerHeight(), |
879 | | - width = this.container.outerWidth(), |
880 | | - dropHeight = this.dropdown.outerHeight(), |
| 878 | + height = this.container.outerHeight(true), |
| 879 | + width = this.container.outerWidth(true), |
| 880 | + dropHeight = this.dropdown.outerHeight(true), |
881 | 881 | viewportBottom = $(window).scrollTop() + document.documentElement.clientHeight, |
882 | 882 | dropTop = offset.top + height, |
883 | 883 | dropLeft = offset.left, |
|
1063 | 1063 |
|
1064 | 1064 | child = $(children[index]); |
1065 | 1065 |
|
1066 | | - hb = child.offset().top + child.outerHeight(); |
| 1066 | + hb = child.offset().top + child.outerHeight(true); |
1067 | 1067 |
|
1068 | 1068 | // if this is the last child lets also make sure select2-more-results is visible |
1069 | 1069 | if (index === children.length - 1) { |
1070 | 1070 | more = results.find("li.select2-more-results"); |
1071 | 1071 | if (more.length > 0) { |
1072 | | - hb = more.offset().top + more.outerHeight(); |
| 1072 | + hb = more.offset().top + more.outerHeight(true); |
1073 | 1073 | } |
1074 | 1074 | } |
1075 | 1075 |
|
1076 | | - rb = results.offset().top + results.outerHeight(); |
| 1076 | + rb = results.offset().top + results.outerHeight(true); |
1077 | 1077 | if (hb > rb) { |
1078 | 1078 | results.scrollTop(results.scrollTop() + (hb - rb)); |
1079 | 1079 | } |
|
1347 | 1347 | if (this.opts.width === "off") { |
1348 | 1348 | return null; |
1349 | 1349 | } else if (this.opts.width === "element"){ |
1350 | | - return this.opts.element.outerWidth() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px'; |
| 1350 | + return this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px'; |
1351 | 1351 | } else if (this.opts.width === "copy" || this.opts.width === "resolve") { |
1352 | 1352 | // check if there is inline style on the element that contains width |
1353 | 1353 | style = this.opts.element.attr('style'); |
|
1368 | 1368 | if (style.indexOf("%") > 0) return style; |
1369 | 1369 |
|
1370 | 1370 | // finally, fallback on the calculated width of the element |
1371 | | - return (this.opts.element.outerWidth() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px'); |
| 1371 | + return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px'); |
1372 | 1372 | } |
1373 | 1373 |
|
1374 | 1374 | return null; |
|
0 commit comments