')
- .attr('data-id', value.id)
- .data('indented', value.indented)
- .css('margin-left', (value.indented * 32) + 'px')
- let line = $('
')
- let content = $('
')
+ let el = document.createElement('div')
+ el.classList.add('list-item')
+ el.setAttribute('data-id', value.id)
+ el.style.marginLeft = (value.indented * 32) + 'px'
+
+ let $el = $(el).data('indented', value.indented)
+
+ let line = document.createElement('div')
+ line.classList.add('line')
+
+ let content = document.createElement('div')
+ content.classList.add('content')
+
line.prepend(content)
- options.transform(value.text, content, value.id, EDITOR)
- line.prepend($(''))
- line.prepend($('▶'))
+
+ options.transform(value.text, $(content), value.id, EDITOR)
+
+ let marker = document.createElement('span')
+ marker.classList.add('marker')
+
+ let fold = document.createElement('span')
+ fold.classList.add('fold')
+ fold.innerHTML = '▶'
+
+ line.prepend(marker)
+ line.prepend(fold)
+
el.prepend(line)
- return el;
+
+ return $el;
}
// TODO: build an actual tree of list items