git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit a97b2ac07374b443c84bbd1f8d2c42f40456a4bb

Fix display of preview for "this is you"

Matt McKegg committed on 10/16/2017, 7:53:10 AM
Parent: 0e9ae696d4ed8f0280bd48256909dd349dd74ee1

Files changed

index.jschanged
locales/en.jsonchanged
main-window.jschanged
modules/profile/html/preview.jschanged
index.jsView
@@ -106,11 +106,17 @@
106106
107107 function setupContext (appName, opts, cb) {
108108 ssbConfig = require('ssb-config/inject')(appName, extend({
109109 port: 8008,
110- blobsPort: 7777
110+ blobsPort: 7777,
111+ // friends: {
112+ // dunbar: 150,
113+ // hops: 2 // down from 3
114+ // }
111115 }, opts))
112116
117+ console.log(ssbConfig)
118+
113119 ssbConfig.keys = ssbKeys.loadOrCreateSync(Path.join(ssbConfig.path, 'secret'))
114120
115121 // fix offline on windows by specifying 127.0.0.1 instead of localhost (default)
116122 var id = ssbConfig.keys.id
locales/en.jsonView
@@ -159,6 +159,7 @@
159159 "other": "You share %s mutual friends with this person."
160160 },
161161 "This person does not follow anyone that follows you": "This person does not follow anyone that follows you",
162162 "They might not receive your private messages or replies. You could try joining a pub that they are a member of.": "They might not receive your private messages or replies. You could try joining a pub that they are a member of.",
163- "External Link": "External Link"
164-}
163+ "External Link": "External Link",
164+ "This is you.": "This is you."
165+}
main-window.jsView
@@ -152,10 +152,11 @@
152152 var rect = element.getBoundingClientRect()
153153 var maxLeft = window.innerWidth - 510
154154 var maxTop = window.innerHeight - 100
155155 var distanceFromRight = window.innerWidth - rect.right
156+ var shouldDisplayBeside = rect.bottom > maxTop || rect.left < 100 || distanceFromRight < 100
156157
157- if (rect.bottom > maxTop || rect.left < 100 || distanceFromRight < 100) {
158+ if (shouldDisplayBeside && rect.bottom > 50) {
158159 preview.style.top = `${Math.min(rect.top, maxTop)}px`
159160 if (rect.right > maxLeft) {
160161 preview.style.left = `${rect.left - 510}px`
161162 } else {
modules/profile/html/preview.jsView
@@ -92,11 +92,11 @@
9292 })
9393 ])
9494 ])
9595 } else if (value[0] === 0) {
96- return i18n('This is you.')
97- } else if (value[0] === 0) {
98- return i18n('This is you.')
96+ return h('section', [
97+ i18n('This is you.')
98+ ])
9999 }
100100 }
101101 })
102102 ])

Built with git-ssb-web