git ssb

16+

Dominic / patchbay



Commit 251a4d7b1477eafd58a6093249e659cf49f23e0c

use pull-scroll to get infinite scrolling

Dominic Tarr committed on 5/14/2016, 12:05:10 PM
Parent: 7cf35de753155a880bece2498dee7cb02c01f251

Files changed

ui.jschanged
ui.jsView
@@ -1,23 +1,15 @@
11 var h = require('hyperscript')
22 var pull = require('pull-stream')
33 var u = require('./util')
4+var Scroller = require('pull-scroll')
45
56 exports.createStream = function createStream (stream, render) {
6- var div = h('div.content')
7+ var div = h('div.column', {style: {'overflow-y': 'auto'}})
78
89 pull(
910 stream,
10- pull.drain(function (data) {
11- var el = render(data)
12- if('string' === typeof el) el = document.createTextNode(el)
13- if(el) {
14- if(div.children.length)
15- div.appendChild(h('hr'))
16- div.appendChild(el)
17- }
18-
19- })
11+ Scroller(div, div, render, false, false)
2012 )
2113
2214 return div
2315 }
@@ -28,4 +20,5 @@
2820 return fn(data, sbot)
2921 })
3022 }
3123 }
24+

Built with git-ssb-web