- return;
- }
-
- html2text({
- element: self.$edited[0],
- success: function(xml) {
- w(222)
- let $xmlelem = $($.parseXML(xml));
- w(333, $xmlelem)
- w($input.data('property'), $input.val());
- $xmlelem.contents().attr($input.data('property'), inputval);
- w(444, $xmlelem)
- let newxml = (new XMLSerializer()).serializeToString($xmlelem[0]);
- w(555, newxml)
- xml2html({
- xml: newxml,
- base: self.doc.getBase(),
- success: function(html) {
- let htmlElem = $(html);
- self.$edited.replaceWith(htmlElem);
- self.edit(htmlElem);
- }
- });
- },
- error: function(e) {console.log(e);},
+
+ if ($input.data("edited")) {
+ if ($input.data("edited-attr")) {
+ $input.data("edited").attr($input.data("edited-attr"), inputval);
+ } else {
+ $input.data("edited").text(inputval);
+ }
+ return;
+ }
+
+ html2text({
+ element: self.$edited[0],
+ success: function(xml) {
+ w(222)
+ let $xmlelem = $($.parseXML(xml));
+ w(333, $xmlelem)
+ w($input.data('property'), $input.val());
+ $xmlelem.contents().attr($input.data('property'), inputval);
+ w(444, $xmlelem)
+ let newxml = (new XMLSerializer()).serializeToString($xmlelem[0]);
+ w(555, newxml)
+ xml2html({
+ xml: newxml,
+ base: self.doc.getBase(),
+ success: function(html) {
+ let htmlElem = $(html);
+ self.$edited.replaceWith(htmlElem);
+ self.edit(htmlElem);
+ }
+ });
+ },
+ error: function(e) {console.log(e);},
+ });
+ self.$edited;