|
@@ -974,7 +974,7 @@ $(function () {
|
|
|
const module = global_modules[mid].moduleDetail;
|
|
|
const key = global_modules[mid].modeName.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '');
|
|
|
let hml = '<div class="content-item" code="' + key + '">' +
|
|
|
- '<h2 class="title">' + global_modules[mid].modeName + '(' + mid + ')</h2>' +
|
|
|
+ '<h2 class="title">' +'<button class="save">编辑</button>'+ global_modules[mid].modeName + '(' + mid + ')</h2>' +
|
|
|
(n > 1 ? '<div class="container">' : '<div class="container content-hts">');
|
|
|
|
|
|
|
|
@@ -1121,6 +1121,26 @@ $(function () {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ var isEditing = false;
|
|
|
+ $('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td').attr('contenteditable', isEditing);
|
|
|
+ $("body").on("click", ".save", function () {
|
|
|
+ isEditing = !isEditing; // 切换状态
|
|
|
+ if (isEditing) {
|
|
|
+ $(this).text('保存');
|
|
|
+ } else {
|
|
|
+ $(this).text('编辑');
|
|
|
+ // let state = saveOrUpdate()
|
|
|
+ // if (state === true) {
|
|
|
+ // console.log("保存成功");
|
|
|
+ // } else {
|
|
|
+ // console.log("保存失败");
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ $('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td').attr('contenteditable', isEditing);
|
|
|
+ });
|
|
|
|
|
|
});
|
|
|
|