Skip to content

Commit

Permalink
Adapt setFrozenFields to recent setFields changes in editor.js
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
glutanimate committed Mar 19, 2019
1 parent 91b3fb3 commit b167aaa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/frozen_fields/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@
for (var i=0; i<fields.length; i++) {
var n = fields[i][0];
var f = fields[i][1];
if (!f) {
f = "<br>";
}
// ----------- mod start -----------
txt += "<tr><td style='width:28px'></td><td class=fname>{0}</td></tr><tr>".format(n);
if (frozen[i]) {
Expand All @@ -101,12 +100,18 @@
}
txt += "<td width=100%%>"
// ----------- mod end -----------
txt += "<div id=f{0} onkeydown='onKey();' oninput='onInput()' onmouseup='onKey();'".format(i);
txt += " onfocus='onFocus(this);' onblur='onBlur();' class=field ";
txt += " onfocus='onFocus(this);' onblur='onBlur();' class='field clearfix' ";
txt += "ondragover='onDragOver(this);' onpaste='onPaste(this);' ";
txt += "oncopy='onCutOrCopy(this);' oncut='onCutOrCopy(this);' ";
txt += "contentEditable=true class=field>{0}</div>".format(f);
// ----------- mod start -----------
txt += "</td>"
// ----------- mod end -----------
txt += "</td></tr>";
}
$("#fields").html("<table cellpadding=0 width=100%% style='table-layout: fixed;'>" + txt + "</table>");
Expand Down

0 comments on commit b167aaa

Please sign in to comment.