git ssb

16+

Dominic / patchbay



Commit 0173c48b79cbde1e8ac112225fce0958e72331a7

give modals the ability to have classNames, don't let them cover tabs

mix irving committed on 6/14/2018, 11:28:44 PM
Parent: 9417449ceabd2b014ad5b6b00c2551006c3f1c26

Files changed

app/html/modal.jschanged
app/html/modal.mcsschanged
app/styles/mcss/markdown.mcsschanged
app/html/modal.jsView
@@ -3,18 +3,18 @@
33
44 exports.gives = nest('app.html.modal')
55
66 exports.create = (api) => {
7- return nest('app.html.modal', (content, { isOpen, onClose } = {}) => {
7 + return nest('app.html.modal', (content, { isOpen, onClose, className = '' } = {}) => {
88 if (typeof isOpen !== 'function') isOpen = Value(false)
99
1010 const openMe = () => isOpen.set(true)
1111 const closeMe = () => {
1212 isOpen.set(false)
1313 if (typeof onClose === 'function') onClose()
1414 }
1515
16- const lb = h('Modal', { className: when(isOpen, '-open', '-close'), 'ev-click': closeMe },
16 + const lb = h('Modal', { classList: [when(isOpen, '-open', '-close'), className], 'ev-click': closeMe },
1717 h('div.content', {'ev-click': (ev) => ev.stopPropagation()}, [
1818 content
1919 ]))
2020
app/html/modal.mcssView
@@ -2,14 +2,14 @@
22 display: flex
33 flex-direction: row
44 position: fixed
55 z-index: 90
6- width: 100%
7- height: 100%
86 text-align: center
9- top: 0
7 + top: 2.5rem
8 + right: 0
9 + bottom: 0
1010 left: 0
11- background: rgba(0,0,0,0.1)
11 + background: rgba(15, 0, 25, 0.78)
1212
1313 div.content {
1414 max-width: 90vw
1515 max-height: 90vh
@@ -47,6 +47,12 @@
4747
4848 -close {
4949 display: none
5050 }
51 +
52 + -dark {
53 + div.content {
54 + background: #000
55 + }
56 + }
5157 }
5258
app/styles/mcss/markdown.mcssView
@@ -2,16 +2,16 @@
22 p, ul, ol {
33 }
44
55 // center images (non-emoji)
6- p {
7- a {
8- img {
9- display: block
10- margin: auto
11- }
12- }
13- }
6 + // p {
7 + // a {
8 + // img {
9 + // display: block
10 + // margin: auto
11 + // }
12 + // }
13 + // }
1414
1515 hr {
1616 height: 0
1717 border: solid #ddd

Built with git-ssb-web