Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copyandpaste #1

Merged
merged 10 commits into from
Jan 12, 2017
Merged

Copyandpaste #1

merged 10 commits into from
Jan 12, 2017

Conversation

lizziesz
Copy link
Contributor

No description provided.

Copy link
Contributor

@BenAychh BenAychh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's chat about the subscription, I could be incorrect.


copyNode() {
this.stateService.userState.setCopiedNodeId();
this.subscription = this.stateService.twiglet.nodes.observable.subscribe((response: OrderedMap<string, Map<string, any>>) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs an unsubscribe or we can just subscribe to all of the nodes in ngOnInit like we do with the userstate on line 33.

@@ -23,6 +23,14 @@ describe('UserStateService', () => {
});
});

it('can set the copied node id to the current node id', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet :)


@HostListener('window:keydown', ['$event'])
handleKeyDown($event) {
if (($event.metaKey || $event.ctrlKey) && $event.code === 'KeyC' && !this.disabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metaKey is the control key on windows so I think you can drop your or $event.ctrlKey and just use metaKey to support all operating systems.

this.disabled = !response.get('isEditing');
this.cd.markForCheck();
userStateServiceResponseToObject.bind(this)(response);
if (!this.userState.currentNode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to set current node to an empty string or can you just leave the null?

@lizziesz lizziesz merged commit 423c47f into master Jan 12, 2017
@lizziesz lizziesz deleted the copyandpaste branch January 12, 2017 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants