diff --git a/static/css/editor.css b/static/css/editor.css index 13193a8..41ba7d1 100644 --- a/static/css/editor.css +++ b/static/css/editor.css @@ -39,4 +39,5 @@ button.note-btn, .note-modal button { color: black !important; background: white !important; border-radius: 0px; + z-index: 99999; } \ No newline at end of file diff --git a/static/js/editor.js b/static/js/editor.js index 74f58ad..db2480a 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -59,7 +59,24 @@ $(document).ready(function () { }); $(".sw-complex").each(function () { - $(this).append("
Click to edit
"); + var eid = $(this).attr("id"); + var eclass = $(this).attr("class"); + var estyle = $(this).attr("style"); + var ecomp = $(this).data("component"); + var ejson = $(this).data("json"); + if (typeof ejson !== "string") { + ejson = JSON.stringify(ejson); + } + $(this).replaceWith( + $('
', { + id: eid, + class: eclass, + style: estyle, + html: $(this).html(), + "data-component": ecomp, + "data-json": ejson + })); + $("[data-component=\"" + ecomp + "\"]").append("
Click to edit
"); }); $(".sw-editbtn").on("click", function () {