Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var plastiq = require('plastiq');
- var h = plastiq.html;
- function render(model) {
- return h('article', h('.title', {
- onblur: function(e) {
- model.title = e.target.innerText.replace(/\n/g, "");
- e.target.innerHTML = '<h1>' + model.title + '</h1>';
- },
- attributes: { contenteditable: true }},
- h.rawHtml('h1', model.title)
- ), JSON.stringify(model));
- }
- var model = { title:"edit me" };
- plastiq.attach(document.body, render, model);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement