mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
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:
@@ -56,10 +56,13 @@ exports.save = function (row, from_topic_edited_only) {
|
|||||||
var topic_changed = false;
|
var topic_changed = false;
|
||||||
var new_topic;
|
var new_topic;
|
||||||
if (message.type === "stream") {
|
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() !== "");
|
topic_changed = (new_topic !== message.subject && new_topic.trim() !== "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Editing a not-yet-acked message (because the original send attempt failed)
|
// Editing a not-yet-acked message (because the original send attempt failed)
|
||||||
// just results in the in-memory message being changed
|
// just results in the in-memory message being changed
|
||||||
if (message.local_id !== undefined) {
|
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.
|
// Hitting enter in topic field isn't so great.
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
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()) {
|
if (topic === compose.empty_topic_placeholder()) {
|
||||||
topic = '';
|
topic = '';
|
||||||
}
|
}
|
||||||
form.find(".message_edit_topic").val(topic).select().focus();
|
form.find(".inline_topic_edit").val(topic).select().focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.is_editing = function (id) {
|
exports.is_editing = function (id) {
|
||||||
|
|||||||
@@ -1551,11 +1551,12 @@ div.focused_table {
|
|||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#inline_topic_edit,
|
||||||
#message_edit_topic {
|
#message_edit_topic {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#message_edit_topic.header-v {
|
#inline_topic_edit.header-v {
|
||||||
height: 18px;
|
height: 18px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: -2px 0 0 0;
|
margin: -2px 0 0 0;
|
||||||
@@ -1569,6 +1570,7 @@ div.focused_table {
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#inline_topic_edit:focus,
|
||||||
#message_edit_topic:focus {
|
#message_edit_topic:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<form id="topic_edit_form" class="form-horizontal">
|
<form id="topic_edit_form" class="form-horizontal">
|
||||||
{{! <div class="controls edit-controls"> }}
|
{{! <div class="controls edit-controls"> }}
|
||||||
<input type="text" value="" class="message_edit_topic header-v" id="message_edit_topic" />
|
<input type="text" value="" class="inline_topic_edit header-v" id="inline_topic_edit" />
|
||||||
<button type="button" class="topic_edit_save primary"><i class="icon-vector-ok"></i></button>
|
<button type="button" class="topic_edit_save primary"><i class="icon-vector-ok"></i></button>
|
||||||
<button type="button" class="topic_edit_cancel primary"><i class="icon-vector-remove"></i></button>
|
<button type="button" class="topic_edit_cancel primary"><i class="icon-vector-remove"></i></button>
|
||||||
{{! </div> }}
|
{{! </div> }}
|
||||||
|
|||||||
Reference in New Issue
Block a user