git ssb

16+

Dominic / patchbay



Commit a7f008995a10dc690974348caecbec007e36228b

minor style + code tweaks to compose

mix irving committed on 1/8/2017, 6:04:46 AM
Parent: ddf533c74d989b38d8a15ce293a021f67153b2cc

Files changed

modules_basic/compose.jschanged
modules_basic/compose.mcsschanged
modules_core/style-mixins.jschanged
style.csschanged
modules_basic/compose.jsView
@@ -26,35 +26,33 @@
2626 'message_compose': true,
2727 'mcss': true
2828 }
2929
30-/*
31- opts can take
32-
33- placeholder: string. placeholder text, defaults to "Write a message"
34- prepublish: function. called before publishing a message.
35- shrink: boolean. set to false, to make composer not shrink (or hide controls) when unfocused.
36-*/
37-
3830 exports.create = function (api) {
3931 return {
4032 message_compose,
4133 mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8')
4234 }
4335
44- function message_compose (meta, opts, cb) {
36 + /*
37 + opts can take
38 +
39 + placeholder: string. placeholder text, defaults to "Write a message"
40 + prepublish: function. called before publishing a message.
41 + shrink: boolean. set to false, to make composer not shrink (or hide controls) when unfocused.
42 + */
43 +
44 + function message_compose (meta = {}, opts = {}, cb) {
45 + if(!meta.type) throw new Error('message must have type')
46 +
4547 if('function' === typeof cb) {
4648 if('function' === typeof opts) {
4749 opts = {prepublish: opts}
4850 }
4951 }
50-
51- if(!opts) opts = {}
5252 opts.prepublish = opts.prepublish || id
5353
5454 var actions
55- meta = meta || {}
56- if(!meta.type) throw new Error('message must have type')
5755
5856 var textArea = h('textarea', {
5957 placeholder: opts.placeholder || 'Write a message',
6058 className: opts.shrink === false ? '-expanded' : '-contracted'
modules_basic/compose.mcssView
@@ -1,9 +1,9 @@
11 Compose {
22 display: flex
33 flex-direction: column
44
5- padding: 1rem .5rem
5 + padding: 1rem .5rem 1rem 7.3rem
66
77 textarea {
88 border: 1px solid gainsboro
99
modules_core/style-mixins.jsView
@@ -1,8 +1,8 @@
11
22 const mixins = `
33 $textPrimary {
4- color: black
4 + color: #222
55 }
66
77 $textSubtle {
88 color: gray
style.cssView
@@ -1,6 +1,7 @@
11 body {
22 font-family: sans-serif;
3 + color: #222;
34 }
45
56 h1, h2, h3, h4, h5, h6, p, ul, ol {
67 margin-top: .35em;

Built with git-ssb-web