mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-13 15:08:33 +01:00
Fix for chosen results pushing down bottom of popup window
This commit is contained in:
parent
147b926490
commit
4dc9f6a472
@ -368,6 +368,28 @@ Copyright (c) 2011 by Harvest
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.results_build();
|
this.results_build();
|
||||||
|
// Check to see if there's enough space below
|
||||||
|
// Thanks, corryworrell https://github.com/harvesthq/chosen/issues/155
|
||||||
|
this.search_results.css('max-height', 'none');
|
||||||
|
|
||||||
|
var windowHeight = $(window).height() + $('html').scrollTop(),
|
||||||
|
dropdownHeight = this.dropdown.height(),
|
||||||
|
dropdownTop = Math.ceil(this.dropdown.offset().top),
|
||||||
|
totalHeight = dropdownHeight + dropdownTop;
|
||||||
|
|
||||||
|
if (totalHeight > windowHeight) {
|
||||||
|
var difference = totalHeight - windowHeight,
|
||||||
|
height = dropdownHeight - difference;
|
||||||
|
|
||||||
|
if (height > 100) {
|
||||||
|
this.search_results.css('max-height', height);
|
||||||
|
} else {
|
||||||
|
this.dropdown.addClass('chzn-above');
|
||||||
|
this.search_results.css('max-height', this.search_results.data('initialMaxHeight'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.search_results.css('max-height', this.search_results.data('initialMaxHeight'));
|
||||||
|
}
|
||||||
this.set_tab_index();
|
this.set_tab_index();
|
||||||
return this.form_field_jq.trigger("liszt:ready", {
|
return this.form_field_jq.trigger("liszt:ready", {
|
||||||
chosen: this
|
chosen: this
|
||||||
@ -610,28 +632,6 @@ Copyright (c) 2011 by Harvest
|
|||||||
"left": 0
|
"left": 0
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check to see if there's enough space below
|
|
||||||
// Thanks, corryworrell https://github.com/harvesthq/chosen/issues/155
|
|
||||||
this.search_results.css('max-height', 'none');
|
|
||||||
|
|
||||||
var windowHeight = $(window).height() + $('html').scrollTop(),
|
|
||||||
dropdownHeight = this.dropdown.height(),
|
|
||||||
dropdownTop = Math.ceil(this.dropdown.offset().top),
|
|
||||||
totalHeight = dropdownHeight + dropdownTop;
|
|
||||||
|
|
||||||
if (totalHeight > windowHeight) {
|
|
||||||
var difference = totalHeight - windowHeight,
|
|
||||||
height = dropdownHeight - difference;
|
|
||||||
|
|
||||||
if (height > 100) {
|
|
||||||
this.search_results.css('max-height', height);
|
|
||||||
} else {
|
|
||||||
this.dropdown.addClass('chzn-above');
|
|
||||||
this.search_results.css('max-height', this.search_results.data('initialMaxHeight'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.search_results.css('max-height', this.search_results.data('initialMaxHeight'));
|
|
||||||
}
|
|
||||||
this.results_showing = true;
|
this.results_showing = true;
|
||||||
this.search_field.focus();
|
this.search_field.focus();
|
||||||
this.search_field.val(this.search_field.val());
|
this.search_field.val(this.search_field.val());
|
||||||
|
Loading…
Reference in New Issue
Block a user