git ssb

16+

Dominic / patchbay



Commit 53596157e8d794eec9cdef21945b4dc01060a4a6

patch-inbox : unread vis!

mixmix committed on 11/2/2018, 3:41:03 AM
Parent: 91eff7281ce5dbfb9a1569327348c887074ac005

Files changed

app/html/scroller.jschanged
package-lock.jsonchanged
package.jsonchanged
app/html/scroller.jsView
@@ -6,9 +6,9 @@
66 exports.create = function (api) {
77 return nest('app.html.scroller', Scroller)
88
99 function Scroller (opts = {}) {
10- const { prepend, content = null, append, classList = [], className = '', title = '' } = opts
10 + const { prepend, content = null, append, classList = [], className = '', title = '', scrollIntoView } = opts
1111
1212 const contentSection = h('section.content', { title: '' }, content)
1313
1414 const container = h('Scroller',
@@ -19,18 +19,18 @@
1919 append ? h('section.bottom', append) : null
2020 ]
2121 )
2222
23- container.scroll = keyscroll(contentSection)
23 + container.scroll = keyscroll(contentSection, scrollIntoView)
2424
2525 return {
2626 content: contentSection,
2727 container
2828 }
2929 }
3030 }
3131
32-function keyscroll (content) {
32 +function keyscroll (content, scrollIntoView = false) {
3333 var curMsgEl
3434
3535 if (!content) return () => {}
3636
@@ -59,11 +59,15 @@
5959
6060 function selectChild (el) {
6161 if (!el) { return }
6262
63- content.parentElement.scrollTop = el.offsetTop - content.parentElement.offsetTop - 10
64- // if (!el.scrollIntoViewIfNeeded && !el.scrollIntoView) return
65- // ;(el.scrollIntoViewIfNeeded || el.scrollIntoView).call(el)
63 + if (scrollIntoView) {
64 + if (!el.scrollIntoViewIfNeeded && !el.scrollIntoView) return
65 + ;(el.scrollIntoViewIfNeeded || el.scrollIntoView).call(el)
66 + } else {
67 + content.parentElement.scrollTop = el.offsetTop - content.parentElement.offsetTop - 10
68 + }
69 +
6670 if (el.focus) el.focus()
6771 curMsgEl = el
6872 }
6973 }
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 377106 bytes
New file size: 377106 bytes
package.jsonView
@@ -65,9 +65,9 @@
6565 "open-external": "^0.1.1",
6666 "patch-context": "^2.0.1",
6767 "patch-drafts": "0.0.6",
6868 "patch-history": "^1.0.0",
69- "patch-inbox": "^1.2.0",
69 + "patch-inbox": "^1.3.0",
7070 "patch-settings": "^1.1.2",
7171 "patch-suggest": "^2.0.2",
7272 "patchbay-book": "^1.0.8",
7373 "patchbay-dark-crystal": "^1.1.1",

Built with git-ssb-web