git ssb

2+

mixmix / ticktack



Commit c832291043e90838b8656aef72999e78f04099cc

issue #69: style and coding fixes as proposed by @mixmix and a new mixin for preventing text selection.

andre alves garzia committed on 1/24/2018, 12:59:02 PM
Parent: 3de6deea99de778ea8784164b9e0976c92e6bfef

Files changed

app/html/lightbox.jschanged
app/html/lightbox.mcsschanged
contact/html/block.jschanged
styles/mixins.jschanged
app/html/lightbox.jsView
@@ -5,15 +5,20 @@
55
66 exports.create = (api) => {
77 return nest('app.html.lightbox', (content, isOpen) => {
88
9- function closeMe() {
10- isOpen.set(false)
11- }
9+ if (typeof isOpen !== 'function') isOpen = Value(false)
1210
13- return h('Lightbox', {className: when(isOpen, '-open', '-close'), 'ev-click': () => closeMe() },
14- h('Content', [
11+ const closeMe = () => isOpen.set(false)
12+
13+
14+ const lb = h('Lightbox', { className: when(isOpen, '-open', '-close'), 'ev-click': closeMe },
15+ h('div.content', {'ev-click': (ev) => ev.stopPropagation()},[
1516 content
1617 ]))
18+
19+ lb.close = closeMe
20+
21+ return lb
1722 })
1823 }
1924
app/html/lightbox.mcssView
@@ -1,46 +1,47 @@
11 Lightbox {
2- display: flex;
3- flex-direction: row;
4- position: fixed;
5- z-index: 999;
6- width: 100%;
7- height: 100%;
8- text-align: center;
9- top: 0;
10- left: 0;
11- background: rgba(0,0,0,0.8);
2+ display: flex
3+ flex-direction: row
4+ position: fixed
5+ z-index: 999
6+ width: 100%
7+ height: 100%
8+ text-align: center
9+ top: 0
10+ left: 0
11+ background: rgba(0,0,0,0.8)
1212
13- div.Content {
14- margin: auto;
15- padding: 30px;
16- border-radius: 5px;
17- $backgroundPrimary
13+ div.content {
14+ margin: auto
15+ padding: 30px
16+ border-radius: 5px
17+ $backgroundPrimary
18+ $dontSelect
1819
19- div.dialog {
20- div.message {
21- $colorFontPrimary
22- }
20+ div.dialog {
21+ div.message {
22+ $colorFontPrimary
23+ }
2324
24- div.actions {
25- display: flex
26- padding-top: 15px;
25+ div.actions {
26+ display: flex
27+ padding-top: 15px
2728
28- div.Button {
29- margin: auto;
29+ div.Button {
30+ margin: auto
3031
31- -primary {
32- $backgroundPrimary
33- }
34- }
35- }
32+ -primary {
33+ $backgroundPrimary
34+ }
3635 }
36+ }
3737 }
38+ }
3839
39- -open {
40- display: flex;
41- }
40+ -open {
41+ display: flex;
42+ }
4243
43- -close {
44- display: none;
45- }
44+ -close {
45+ display: none;
46+ }
4647 }
contact/html/block.jsView
@@ -27,17 +27,23 @@
2727 const youBlockThem = computed(theirBlockers, blockers => blockers.includes(myId))
2828 const { unblock, block } = api.contact.async
2929 const className = when(youBlockThem, '-blocking')
3030
31+ const isOpen = Value(false)
32+
33+ const blockAndClose = (feed) => {
34+ block(feed)
35+ isOpen.set(false)
36+ }
37+
3138 const confirmationDialog = h("div.dialog", [
3239 h("div.message",strings.userShow.action.blockConfirmationMessage),
3340 h("div.actions", [
34- h('Button', strings.userShow.action.cancel),
35- h('Button -primary',{'ev-click': () => block(feed)}, strings.userShow.action.block)
41+ h('Button', {'ev-click': () => isOpen.set(false)}, strings.userShow.action.cancel),
42+ h('Button -primary', {'ev-click': () => blockAndClose(feed)}, strings.userShow.action.block)
3643 ])
3744 ])
3845
39- const isOpen = Value(false)
4046 const lb = api.app.html.lightbox(confirmationDialog, isOpen)
4147
4248 return h('Block', { className }, [
4349 when(theirBlockers.sync,
styles/mixins.jsView
@@ -180,5 +180,10 @@
180180 color: #c121dc
181181 border: 1px solid #e6e6e6
182182 border-radius: 2px
183183 }
184+
185+$dontSelect {
186+ user-select: none !important
187+ -webkit-touch-callout: none !important
188+}
184189 `

Built with git-ssb-web