Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(store): selectable element
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReincarnator committed Dec 7, 2017
1 parent 3f70c33 commit d1a61a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { PatternFolder } from './pattern/folder';
import * as FileUtils from 'fs';
import { observable } from 'mobx';
import { Page } from './page';
import { PageElement } from './page/page_element';
import { PageRef } from './page/page_ref';
import * as PathUtils from 'path';
import { Pattern } from './pattern';
import { Project } from './project';

export class Store {
@observable private currentPage?: Page;
@observable private selectedElement?: PageElement;
private projects: Project[] = [];
private patternRoot: PatternFolder;
@observable private styleGuidePath: string;
Expand Down Expand Up @@ -37,6 +39,10 @@ export class Store {
return PathUtils.join(this.styleGuidePath, 'stacked', 'projects');
}

public getSelectedElement(): PageElement | undefined {
return this.selectedElement;
}

public getStyleGuidePath(): string {
return this.styleGuidePath;
}
Expand Down Expand Up @@ -74,5 +80,10 @@ export class Store {

public openPage(projectId: string, pageId: string): void {
this.currentPage = new Page(this, projectId, pageId);
this.selectedElement = undefined;
}

public setSelectedElement(selectedElement: PageElement): void {
this.selectedElement = selectedElement;
}
}

0 comments on commit d1a61a7

Please sign in to comment.