Study: Update glyphs on board when they change

pull/9417/head
Benedikt Werner 2021-07-15 07:25:02 +02:00
parent 306b660c19
commit 9e9803eed3
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
3 changed files with 8 additions and 11 deletions

View File

@ -9,7 +9,7 @@
flex: 1 0 30%;
}
a {
button {
@extend %flex-center-nowrap;
@include transition;
@ -18,6 +18,9 @@
height: 2.3em;
line-height: 2.3em;
align-items: stretch;
border: none;
background: transparent;
width: 100%;
&::before {
@extend %flex-center;

View File

@ -558,6 +558,7 @@ export default function (
setMemberActive(who);
if (wrongChapter(d)) return;
ctrl.tree.setGlyphsAt(d.g, position.path);
if (ctrl.path === position.path) ctrl.setAutoShapes();
redraw();
},
clock(d) {

View File

@ -22,17 +22,10 @@ export interface GlyphCtrl {
function renderGlyph(ctrl: GlyphCtrl, node: Tree.Node) {
return function (glyph: Tree.Glyph) {
return h(
'a',
'button',
{
hook: bind(
'click',
_ => {
ctrl.toggleGlyph(glyph.id);
return false;
},
ctrl.redraw
),
attrs: { 'data-symbol': glyph.symbol },
hook: bind('click', _ => ctrl.toggleGlyph(glyph.id), ctrl.redraw),
attrs: { 'data-symbol': glyph.symbol, type: 'button' },
class: {
active: !!node.glyphs && !!node.glyphs.find(g => g.id === glyph.id),
},