mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Merge pull request #889 from glacambre/fix_commandline_on_svgs
Fix infinite recursion on SVG
This commit is contained in:
commit
9597f2facb
1 changed files with 13 additions and 2 deletions
|
@ -61,7 +61,10 @@ export function show() {
|
||||||
cmdline_iframe.contentWindow.document.body.offsetHeight + "px"
|
cmdline_iframe.contentWindow.document.body.offsetHeight + "px"
|
||||||
cmdline_iframe.setAttribute("style", `height: ${height} !important;`)
|
cmdline_iframe.setAttribute("style", `height: ${height} !important;`)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
cmdline_logger.error(e)
|
// Note: We can't use cmdline_logger.error because it will try to log
|
||||||
|
// the error in the commandline, which we can't show!
|
||||||
|
// cmdline_logger.error(e)
|
||||||
|
console.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,6 +73,9 @@ export function hide() {
|
||||||
cmdline_iframe.classList.add("hidden")
|
cmdline_iframe.classList.add("hidden")
|
||||||
cmdline_iframe.setAttribute("style", "height: 0px !important;")
|
cmdline_iframe.setAttribute("style", "height: 0px !important;")
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// Using cmdline_logger here is OK because cmdline_logger won't try to
|
||||||
|
// call hide(), thus we avoid the recursion that happens for show() and
|
||||||
|
// focus()
|
||||||
cmdline_logger.error(e)
|
cmdline_logger.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +84,11 @@ export function focus() {
|
||||||
try {
|
try {
|
||||||
cmdline_iframe.focus()
|
cmdline_iframe.focus()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
cmdline_logger.error(e)
|
// Note: We can't use cmdline_logger.error because it will try to log
|
||||||
|
// the error in the commandline, which will need to focus() it again,
|
||||||
|
// which will throw again...
|
||||||
|
// cmdline_logger.error(e)
|
||||||
|
console.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +96,7 @@ export function blur() {
|
||||||
try {
|
try {
|
||||||
cmdline_iframe.blur()
|
cmdline_iframe.blur()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// Same as with hide(), it's ok to use cmdline_logger here
|
||||||
cmdline_logger.error(e)
|
cmdline_logger.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue