[editor] more fixes webnotes/erpnext#1011
This commit is contained in:
parent
68b1e32256
commit
dc00dc0445
1 changed files with 5 additions and 5 deletions
|
|
@ -446,7 +446,7 @@ bsHTMLEditor = Class.extend({
|
|||
this.modal.addClass("wn-ignore-click");
|
||||
this.modal.find(".btn-primary").on("click", function() {
|
||||
var html = me.modal.find("textarea").val();
|
||||
$.each(me.dataurls, function(key, val) {
|
||||
$.each(me.editor.dataurls, function(key, val) {
|
||||
html = html.replace(key, val);
|
||||
})
|
||||
me.editor.html(html);
|
||||
|
|
@ -459,13 +459,13 @@ bsHTMLEditor = Class.extend({
|
|||
this.modal.modal("show")
|
||||
var html = me.editor.html();
|
||||
// pack dataurls so that html display is faster
|
||||
this.dataurls = {}
|
||||
this.editor.dataurls = {}
|
||||
html = html.replace(/<img\s*src=\s*["\'](data:[^,]*),([^"\']*)["\']/g, function(full, g1, g2) {
|
||||
var key = g2.slice(0,5) + "..." + g2.slice(-5);
|
||||
me.dataurls[key] = g1 + "," + g2;
|
||||
me.editor.dataurls[key] = g1 + "," + g2;
|
||||
return '<img src="'+g1 + "," + key+'"';
|
||||
})
|
||||
this.modal.find("textarea").html(html_beautify(html));
|
||||
});
|
||||
this.modal.find("textarea").val(html_beautify(html));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue