message_edit: Cleanup unnecessary 2-layer nesting.

This commit is contained in:
Tim Abbott
2016-10-22 18:35:42 -07:00
parent 5b3caa4d18
commit bd416c0425

View File

@@ -157,9 +157,11 @@ function edit_message (row, raw_content) {
});
}
if (page_params.realm_message_content_edit_limit_seconds > 0) {
// add timer
if (can_edit_content &&
page_params.realm_message_content_edit_limit_seconds > 0) {
var timer_row = row.find('.message_edit_countdown_timer');
if (can_edit_content) { // Add a visual timer
// I believe these need to be defined outside the countdown_timer, since
// row just refers to something like the currently selected message, and
// can change out from under us
@@ -192,7 +194,6 @@ function edit_message (row, raw_content) {
}
}, 1000);
}
}
var edit_row = row.find(".message_edit");
if ((message.type === 'stream' && message.subject === compose.empty_topic_placeholder()) ||