topic_edit_form: Rename message_edit_topic to inline_topic_edit.

message_edit_form.handlebars already has a message_edit_topic that
refers to the topic edit section of message editing, and this made
things very confusing.
This commit is contained in:
Rishi Gupta
2016-10-25 14:19:43 -07:00
committed by Tim Abbott
parent 39e0886361
commit d14f276322
3 changed files with 14 additions and 5 deletions

View File

@@ -56,10 +56,13 @@ exports.save = function (row, from_topic_edited_only) {
var topic_changed = false;
var new_topic;
if (message.type === "stream") {
new_topic = row.find(".message_edit_topic").val();
if (from_topic_edited_only) {
new_topic = row.find(".inline_topic_edit").val();
} else {
new_topic = row.find(".message_edit_topic").val();
}
topic_changed = (new_topic !== message.subject && new_topic.trim() !== "");
}
// Editing a not-yet-acked message (because the original send attempt failed)
// just results in the in-memory message being changed
if (message.local_id !== undefined) {
@@ -119,6 +122,10 @@ function handle_edit_keydown(from_topic_edited_only, e) {
// Hitting enter in topic field isn't so great.
e.stopPropagation();
e.preventDefault();
} else if (e.target.id === "inline_topic_edit" && code === 13) {
// Hitting enter in topic field isn't so great.
e.stopPropagation();
e.preventDefault();
}
}
@@ -310,7 +317,7 @@ exports.start_topic_edit = function (recipient_row) {
if (topic === compose.empty_topic_placeholder()) {
topic = '';
}
form.find(".message_edit_topic").val(topic).select().focus();
form.find(".inline_topic_edit").val(topic).select().focus();
};
exports.is_editing = function (id) {