git ssb

16+

Dominic / patchbay



Commit f615fd0a3c6e9a30d42fa265b44af3997347103a

minimal scroller style for new hypertabs

mix irving committed on 2/2/2017, 10:45:55 AM
Parent: f68b2a486afb54608328425f7f0315dfaa7d84e5

Files changed

modules_basic/avatar/avatar.jschanged
modules_core/search-box.jschanged
modules_core/search-box.mcssadded
style.csschanged
modules_basic/avatar/avatar.jsView
@@ -20,8 +20,9 @@
2020 avatar_name_link
2121 }
2222
2323 function avatar (author, classes) {
24 + // ??? BUG
2425 return exports.avatar_image_name_link(author, classes)
2526 }
2627
2728 function avatar_image_name_link (author, classes) {
modules_core/search-box.jsView
@@ -1,37 +1,48 @@
11 'use strict'
2-var h = require('hyperscript')
2 +const h = require('../h')
3 +const fs = require('fs')
34
5 +
46 exports.needs = {
57 suggest_search: 'map', //REWRITE
68 build_suggest_box: 'first'
79 }
810
9-exports.gives = 'search_box'
11 +exports.gives = {
12 + search_box: true,
13 + mcss: true
14 +}
1015
1116 exports.create = function (api) {
1217
13- return function (go) {
18 + return {
19 + search_box,
20 + mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8')
21 + }
22 +
23 + function search_box (go) {
24 + var search = h('Search', [
25 + h('input', {
26 + type: 'search',
27 + placeholder: 'Commands',
28 + 'ev-click': ev => {
29 + switch (ev.keyCode) {
30 + case 13: // enter
31 + ev.stopPropagation()
32 + suggestBox.complete()
1433
15- var search = h('input.searchprompt', {
16- type: 'search',
17- placeholder: 'Commands',
18- onkeydown: ev => {
19- switch (ev.keyCode) {
20- case 13: // enter
21- ev.stopPropagation()
22- suggestBox.complete()
23-
24- if (go(search.value.trim(), !ev.ctrlKey))
34 + if (go(search.value.trim(), !ev.ctrlKey))
35 + search.blur()
36 + return
37 + case 27: // escape
38 + ev.preventDefault()
2539 search.blur()
26- return
27- case 27: // escape
28- ev.preventDefault()
29- search.blur()
30- return
40 + return
41 + }
3142 }
32- }
33- })
43 + })
44 + ])
3445
3546 search.activate = (sigil, ev) => {
3647 search.focus()
3748 ev.preventDefault()
modules_core/search-box.mcssView
@@ -1,0 +1,13 @@
1 +Search {
2 + input {
3 + height: 1.4rem
4 + border-radius: .1rem
5 +
6 + padding-left: .7rem
7 + padding-right: .5rem
8 +
9 + margin-left: 1em
10 + /* margin-right: 1em */
11 + }
12 +}
13 +
style.cssView
@@ -236,17 +236,8 @@
236236
237237 /* searchprompt */
238238
239239 .searchprompt {
240- float: left;
241- width: 85%;
242- height: 2em;
243- margin-top: .3em;
244- border-radius: 1em;
245- padding-left: .7em;
246- padding-right: 0.5em;
247- margin-left: 1em;
248- margin-right: 1em;
249240 }
250241
251242 /* TextNodeSearcher highlights */
252243

Built with git-ssb-web