Commit 04001e44 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

set the right canvas state when hiding the search bar

parent bfc68334
...@@ -896,9 +896,10 @@ function nw_create_patch_window_menus(name) { ...@@ -896,9 +896,10 @@ function nw_create_patch_window_menus(name) {
canvas_events.search(); canvas_events.search();
} else { } else {
find_bar.style.setProperty('display', 'none'); find_bar.style.setProperty('display', 'none');
// this is wrong and causes bug... we need to set back to whatever state // "normal" seems to be the only viable state for the
// we used to be in... probably need a last_state var // canvas atm. But if there are other states added later,
canvas_events.none(); // we might need to fetch the previous state here.
canvas_events.normal();
} }
}, },
key: 'f', key: 'f',
......
...@@ -2936,7 +2936,6 @@ function gui_textarea(cid, tag, type, x, y, max_char_width, text, ...@@ -2936,7 +2936,6 @@ function gui_textarea(cid, tag, type, x, y, max_char_width, text,
if (p !== null) { if (p !== null) {
p.parentNode.removeChild(p); p.parentNode.removeChild(p);
} }
// this is wrong and causes bug... we need it to go back to previous state
if (patchwin[cid].window.canvas_events.get_previous_state() === if (patchwin[cid].window.canvas_events.get_previous_state() ===
'search') { 'search') {
patchwin[cid].window.canvas_events.search(); patchwin[cid].window.canvas_events.search();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment