Make pressing escape also un-narrow

(imported from commit 17d2cc3e8074af332f98588ad201ec342476d51f)
This commit is contained in:
Zev Benjamin 2012-10-11 14:30:34 -04:00
parent 9811bd5f8a
commit adf75d48e1
3 changed files with 11 additions and 3 deletions

View File

@ -10,7 +10,7 @@ var globals =
// compose.js
+ ' show_compose hide_compose toggle_compose compose_button'
+ ' compose_stream_name validate_message'
+ ' composing_message compose_stream_name validate_message'
+ ' status_classes'
// dom_access.js

View File

@ -42,6 +42,10 @@ function composing_huddle_message() {
return $("#personal-message").is(":visible");
}
function composing_message() {
return composing_stream_message() || composing_huddle_message();
}
function compose_stream_name() {
return $.trim($("#stream").val());
}

View File

@ -74,8 +74,12 @@ function process_hotkey(code) {
select_message(get_last_visible(), false);
}
return false;
case 27: // Esc: hide compose pane
hide_compose();
case 27: // Esc: hide compose pane or un-narrow
if (composing_message()) {
hide_compose();
} else {
show_all_messages();
}
return process_hotkey;
case 99: // 'c': compose
compose_button();