Merge pull request #966 from djsmith42/master
Fix mask height/width when document is shorter than window
This commit is contained in:
commit
3fe95ac5a4
15
select2.js
15
select2.js
@ -1121,9 +1121,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.dropdown.attr("id", "select2-drop");
|
this.dropdown.attr("id", "select2-drop");
|
||||||
|
|
||||||
// show the elements
|
// show the elements
|
||||||
mask.css({
|
mask.css(_makeMaskCss());
|
||||||
width: document.documentElement.scrollWidth,
|
|
||||||
height: document.documentElement.scrollHeight});
|
|
||||||
mask.show();
|
mask.show();
|
||||||
this.dropdown.show();
|
this.dropdown.show();
|
||||||
this.positionDropdown();
|
this.positionDropdown();
|
||||||
@ -1136,14 +1134,19 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
var that = this;
|
var that = this;
|
||||||
this.container.parents().add(window).each(function () {
|
this.container.parents().add(window).each(function () {
|
||||||
$(this).bind(resize+" "+scroll+" "+orient, function (e) {
|
$(this).bind(resize+" "+scroll+" "+orient, function (e) {
|
||||||
$("#select2-drop-mask").css({
|
$("#select2-drop-mask").css(_makeMaskCss());
|
||||||
width:document.documentElement.scrollWidth,
|
|
||||||
height:document.documentElement.scrollHeight});
|
|
||||||
that.positionDropdown();
|
that.positionDropdown();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.focusSearch();
|
this.focusSearch();
|
||||||
|
|
||||||
|
function _makeMaskCss() {
|
||||||
|
return {
|
||||||
|
width : Math.max(document.documentElement.scrollWidth, $(window).width()),
|
||||||
|
height : Math.max(document.documentElement.scrollHeight, $(window).height())
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
|
Loading…
x
Reference in New Issue
Block a user