Stream Name to Content Editable.

This changes the stream name component to be content editable.
This commit is contained in:
Brock Whittaker
2016-12-16 18:53:12 -08:00
committed by Brock Whittaker
parent eaeb0e32a7
commit 14b471a29f
3 changed files with 41 additions and 38 deletions

View File

@@ -423,9 +423,8 @@ $(function () {
(function () {
var map = {
".stream-description-editable": function (e) {
subs.change_stream_description(e);
},
".stream-description-editable": subs.change_stream_description,
".stream-name-editable": subs.change_stream_name
};
$(document).on("keydown", ".editable-section", function (e) {
@@ -461,9 +460,13 @@ $(function () {
edit_area.text(edit_area.attr("data-prev-text"));
$(this).html("");
} else {
$(edit_area).attr("data-prev-text", edit_area.text().trim());
$("[data-finish-editing='" + selector + "']").show();
edit_area.attr("contenteditable", true).focus().select();
edit_area.attr("data-prev-text", edit_area.text().trim())
.attr("contenteditable", true);
place_caret_at_end(edit_area[0]);
$(this).html("×");
}
});