Skip to content

Commit 00d58a9

Browse files
author
Salma Alam-Naylor
committed
WIP for expandFretboard event emit
1 parent 7c31575 commit 00d58a9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

apps/fretonator-web/src/app/pages/learn/patterns-index/patterns-index.component.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
22
import { PatternFretMaps, PatternModeSelectors } from '../../../util/constants';
33
import { Mode } from '../../../util/types';
44

@@ -8,9 +8,15 @@ import { Mode } from '../../../util/types';
88
styleUrls: ['./patterns-index.component.scss']
99
})
1010
export class PatternsIndexComponent implements OnInit {
11+
@Output() expandFretboard = new EventEmitter<MouseEvent>();
1112
modeSelectors = PatternModeSelectors;
1213
selectedMode = Mode.ionian;
1314
selectedFretMap = PatternFretMaps.ionian;
15+
modesRequiringExpansion = [
16+
Mode.mixolydian,
17+
Mode.aolian,
18+
Mode.locrian
19+
];
1420

1521
constructor() {
1622
}
@@ -21,6 +27,16 @@ export class PatternsIndexComponent implements OnInit {
2127
setPattern(mode: Mode) {
2228
this.selectedMode = mode;
2329
this.selectedFretMap = PatternFretMaps[mode];
30+
31+
if (this.modesRequiringExpansion.indexOf(mode) > -1) {
32+
this.expandFretboardHere();
33+
}
2434
}
2535

36+
expandFretboardHere() {
37+
//JIM I JUST CANNOT WORK OUT WHERE TO PUT THIS DIRECTIVE
38+
// IS IT ON THE INSTANCE OF FRETBOARD ON PATTERNS-INDEX?
39+
// IS IN IN THE FRETBOARD HTML?
40+
this.expandFretboard.emit();
41+
}
2642
}

0 commit comments

Comments
 (0)