Commit a97b2ac07374b443c84bbd1f8d2c42f40456a4bb
Fix display of preview for "this is you"
Matt McKegg committed on 10/16/2017, 7:53:10 AMParent: 0e9ae696d4ed8f0280bd48256909dd349dd74ee1
Files changed
index.js | changed |
locales/en.json | changed |
main-window.js | changed |
modules/profile/html/preview.js | changed |
index.js | ||
---|---|---|
@@ -106,11 +106,17 @@ | ||
106 | 106 | |
107 | 107 | function setupContext (appName, opts, cb) { |
108 | 108 | ssbConfig = require('ssb-config/inject')(appName, extend({ |
109 | 109 | port: 8008, |
110 | - blobsPort: 7777 | |
110 | + blobsPort: 7777, | |
111 | + // friends: { | |
112 | + // dunbar: 150, | |
113 | + // hops: 2 // down from 3 | |
114 | + // } | |
111 | 115 | }, opts)) |
112 | 116 | |
117 | + console.log(ssbConfig) | |
118 | + | |
113 | 119 | ssbConfig.keys = ssbKeys.loadOrCreateSync(Path.join(ssbConfig.path, 'secret')) |
114 | 120 | |
115 | 121 | // fix offline on windows by specifying 127.0.0.1 instead of localhost (default) |
116 | 122 | var id = ssbConfig.keys.id |
locales/en.json | ||
---|---|---|
@@ -159,6 +159,7 @@ | ||
159 | 159 | "other": "You share %s mutual friends with this person." |
160 | 160 | }, |
161 | 161 | "This person does not follow anyone that follows you": "This person does not follow anyone that follows you", |
162 | 162 | "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.js | ||
---|---|---|
@@ -152,10 +152,11 @@ | ||
152 | 152 | var rect = element.getBoundingClientRect() |
153 | 153 | var maxLeft = window.innerWidth - 510 |
154 | 154 | var maxTop = window.innerHeight - 100 |
155 | 155 | var distanceFromRight = window.innerWidth - rect.right |
156 | + var shouldDisplayBeside = rect.bottom > maxTop || rect.left < 100 || distanceFromRight < 100 | |
156 | 157 | |
157 | - if (rect.bottom > maxTop || rect.left < 100 || distanceFromRight < 100) { | |
158 | + if (shouldDisplayBeside && rect.bottom > 50) { | |
158 | 159 | preview.style.top = `${Math.min(rect.top, maxTop)}px` |
159 | 160 | if (rect.right > maxLeft) { |
160 | 161 | preview.style.left = `${rect.left - 510}px` |
161 | 162 | } else { |
Built with git-ssb-web