PR feedback, cleanup

This commit is contained in:
Bruno Windels 2019-05-15 09:46:08 +01:00
parent dc21faa240
commit d83e278f6b
4 changed files with 8 additions and 57 deletions

View file

@ -14,22 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
export function rerenderModel(editor, model) {
while (editor.firstChild) {
editor.removeChild(editor.firstChild);
}
let lineContainer = document.createElement("div");
editor.appendChild(lineContainer);
for (const part of model.parts) {
if (part.type === "newline") {
lineContainer = document.createElement("div");
editor.appendChild(lineContainer);
} else {
lineContainer.appendChild(part.toDOMNode());
}
}
}
export function renderModel(editor, model) {
const lines = model.parts.reduce((lines, part) => {
if (part.type === "newline") {