diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index 12cd7d39..7d2f1984 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -163,7 +163,9 @@ select { select[multiple="multiple"] { height: auto; } -.button, input[type="submit"] { +.button, +[type="button"], +input[type="submit"] { display: block; margin-bottom: 14px; text-align: center; @@ -177,12 +179,15 @@ select[multiple="multiple"] { border: none; text-decoration: none; } -.dark .button { +.dark .button, +.dark [type="button"] { background-color: #2a2e30; color: #eeeeec; border: 1px solid #1b1f20; } -.dark .button:hover, .dark input[type="submit"]:hover { +.dark .button:hover, +.dark [type="button"]:hover, +.dark input[type="submit"]:hover { background-color: #2e3436; } .dark a { @@ -361,7 +366,8 @@ input.switch:checked ~ label:after { .umap-multiplechoice.by4 { grid-template-columns: 1fr 1fr 1fr 1fr; } -.button-bar .button { +.button-bar .button, +.button-bar [type="button"] { display: inline-block; } .umap-multiplechoice input[type='radio'] { @@ -558,10 +564,12 @@ input.blur { border-top-right-radius: 0; border-bottom-right-radius: 0; } -.blur + .button:before { +.blur + .button:before, +.blur + [type="button"]:before { content: '✔'; } -.blur + .button { +.blur + .button, +.blur + [type="button"] { width: 40px; height: 18px; display: inline-block; @@ -571,7 +579,8 @@ input.blur { border-bottom-left-radius: 0; box-sizing: border-box; } -input[type=hidden].blur + .button { +input[type=hidden].blur + .button, +input[type=hidden].blur + [type="button"] { display: none; } diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index a5f79ec6..7582c9b5 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -315,10 +315,10 @@ L.DomUtil.createFieldset = (container, legend, options) => { L.DomUtil.createButton = (className, container, content, callback, context) => { // TODO: actually switch to buttons’ elements. - const el = L.DomUtil.add('a', className, container, content) - el.href = '#' - // const el = L.DomUtil.add('button', className, container, content) - // el.type = 'button' + // const el = L.DomUtil.add('a', className, container, content) + // el.href = '#' + const el = L.DomUtil.add('button', className, container, content) + el.type = 'button' if (callback) { L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback, context) }