mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-17 06:10:30 +00:00
a11y: improve search box #821
This commit is contained in:
parent
8f135335f3
commit
2c8cf85ea1
5 changed files with 29 additions and 23 deletions
static/js
|
@ -93,9 +93,10 @@ var autoComplete = (function(){
|
|||
pageXOffset = window.pageXOffset || document.documentElement.scrollLeft;
|
||||
pageYOffset = window.pageYOffset || document.documentElement.scrollTop;
|
||||
}
|
||||
that.sc.style.left = Math.round(rect.left + pageXOffset + o.offsetLeft - parentOffsetLeft) + 'px';
|
||||
that.sc.style.top = Math.round(rect.bottom + pageYOffset + o.offsetTop - parentOffsetTop) + 'px';
|
||||
that.sc.style.width = Math.round(rect.right - rect.left) + 'px'; // outerWidth
|
||||
// Is this really the job of the tool or should it be defered to the user?
|
||||
// that.sc.style.left = Math.round(rect.left + pageXOffset + o.offsetLeft - parentOffsetLeft) + 'px';
|
||||
// that.sc.style.top = Math.round(rect.bottom + pageYOffset + o.offsetTop - parentOffsetTop) + 'px';
|
||||
// that.sc.style.width = Math.round(rect.right - rect.left) + 'px'; // outerWidth
|
||||
if (!resize) {
|
||||
that.sc.style.display = 'block';
|
||||
if (!that.sc.maxHeight) { that.sc.maxHeight = parseInt((window.getComputedStyle ? getComputedStyle(that.sc, null) : that.sc.currentStyle).maxHeight); }
|
||||
|
|
|
@ -271,7 +271,7 @@ function startSearch(){
|
|||
|
||||
var searchList = new autoComplete({
|
||||
/* selector for the search box element */
|
||||
selectorToInsert: '#R-header-wrapper',
|
||||
selectorToInsert: 'search:has(.searchbox)',
|
||||
selector: '#R-search-by',
|
||||
/* source is the callback to perform the search */
|
||||
source: function(term, response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue