Skip to content

Commit

Permalink
Fix search
Browse files Browse the repository at this point in the history
By mistake, was adding the action to the wrong DOM element.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
  • Loading branch information
gastmaier committed May 6, 2024
1 parent 3115458 commit 58ed2bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion adi_doctools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .role import setup as role_setup
from .lut import get_lut

__version__ = "0.3.29"
__version__ = "0.3.30"

logger = logging.getLogger(__name__)

Expand Down
13 changes: 7 additions & 6 deletions adi_doctools/theme/cosmic/scripts/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class Navigation {
}).onclick(this, () => {
DOM.switchState($.searchArea)
DOM.switchState($.searchAreaBg)
$.searchBox.focus()
$.searchBox.$.select()
$.searchInput.focus()
$.searchInput.$.select()
})
$.changeTheme = new DOM('button', {
className: this.currentTheme === 'dark' ? 'icon on' : 'icon',
Expand All @@ -55,8 +55,9 @@ class Navigation {
DOM.switchState($.searchAreaBg)
})
$.searchArea = new DOM(DOM.get('.search-area'))
$.searchBox = new DOM(DOM.get('.search-area input'))
$.searchArea.$['action'] = DOM.get('link[rel="search"]').href
$.searchForm = new DOM(DOM.get('form', $.searchArea))
$.searchInput = new DOM(DOM.get('input', $.searchForm))
$.searchForm.$['action'] = DOM.get('link[rel="search"]').href
$.body.append([$.searchAreaBg])

$.rightHeader = new DOM(DOM.get('header #right span.reverse')).append([$.changeTheme, $.searchButton])
Expand All @@ -73,8 +74,8 @@ class Navigation {
if (e.key === '/' && !this.$.searchArea.classList.contains('on')) {
DOM.switchState(this.$.searchArea)
DOM.switchState(this.$.searchAreaBg)
this.$.searchBox.focus()
this.$.searchBox.$.select()
this.$.searchInput.focus()
this.$.searchInput.$.select()
} else if (e.code === 'Escape') {
if (this.$.searchArea.classList.contains('on')) {
DOM.switchState(this.$.searchArea)
Expand Down

0 comments on commit 58ed2bb

Please sign in to comment.