Add a close button to the compose dialog (since users may not know to use Esc)

(imported from commit 47dca0b2c76449be1d885b74c1cf6b036aa459c7)
This commit is contained in:
Kevin Mehall
2013-06-12 17:57:43 -04:00
parent 6cb7baf598
commit 0cd90cbe4a
4 changed files with 14 additions and 2 deletions

View File

@@ -1,9 +1,10 @@
<div class="row-fluid"> <div class="row-fluid">
<div class="span12" id="compose"> <div class="span12" id="compose">
<div class="message_comp"> <div class="message_comp">
<button type="button" class="close" id='compose_close'>×</button>
<div class="alert" id="send-status"> <div class="alert" id="send-status">
<span class="send-status-close">&times;</span> <span class="send-status-close">&times;</span>
<span id="error-msg"></span> <span id="error-msg"></span>
</div> </div>
<form id="send_message_form" action="/json/send_message" method="post"> <form id="send_message_form" action="/json/send_message" method="post">
{% csrf_token %} {% csrf_token %}

View File

@@ -165,6 +165,8 @@ exports.start = function (msg_type, opts) {
return; return;
} }
$("#compose_close").show();
var default_opts = { var default_opts = {
message_type: msg_type, message_type: msg_type,
stream: '', stream: '',
@@ -232,6 +234,7 @@ function abort_xhr () {
} }
exports.cancel = function () { exports.cancel = function () {
$("#compose_close").hide();
compose.clear(); compose.clear();
compose.hide(); compose.hide();
abort_xhr(); abort_xhr();

View File

@@ -1544,6 +1544,10 @@ $(function () {
} }
}); });
$("#compose_close").click(function (e) {
compose.cancel();
});
// initialize other stuff // initialize other stuff
typeahead_helper.update_all_recipients(page_params.people_list); typeahead_helper.update_all_recipients(page_params.people_list);
composebox_typeahead.initialize(); composebox_typeahead.initialize();

View File

@@ -767,6 +767,10 @@ blockquote p {
z-index: 1; z-index: 1;
} }
#compose_close {
display: none;
}
/* Like .nav-tabs > li > a */ /* Like .nav-tabs > li > a */
#send-status { #send-status {
width: 90%; width: 90%;