-
Notifications
You must be signed in to change notification settings - Fork 33
minor tweaks @ Repo.vue #18
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,9 +167,11 @@ | |
| }, | ||
|
|
||
| data() { | ||
| const repoName = decodeURIComponent( this.repoName ); | ||
|
|
||
| return { | ||
| currentCommand : null, | ||
| repo : this.repos.find( repo => repo.name === decodeURIComponent( this.repoName ) ), | ||
| repo : this.repos.find( ( { name } ) => name === repoName ), | ||
| scripts : [], | ||
| scriptElements : null | ||
| }; | ||
|
|
@@ -183,15 +185,17 @@ | |
|
|
||
| methods : { | ||
| handleUp( target ) { | ||
| if ( this.scriptElements.length < 1 ) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. early escape (could possibly be added to |
||
| return; | ||
| } | ||
|
|
||
| let index = [].indexOf.call( this.scriptElements, target ); | ||
|
|
||
| if ( index === -1 ) { | ||
| index = this.scriptElements.length; | ||
| } | ||
|
|
||
| if ( index > 0 ) { | ||
| this.scriptElements[ index - 1 ].focus(); | ||
| } | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 for the early escape approach, but I'll revert this parts of this change in master again. Because this is still needed. Currently it's throwing... I missed that one too. Logic should be, if the current focused element is not the first one, then focus the one before.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oooh! |
||
| this.scriptElements[ index - 1 ].focus(); | ||
| }, | ||
|
|
||
| handleRight( target ) { | ||
|
|
@@ -203,7 +207,7 @@ | |
| handleDown( target ) { | ||
| let index = [].indexOf.call( this.scriptElements, target ); | ||
|
|
||
| if ( index < this.scriptElements.length -1 ) { | ||
| if ( index < this.scriptElements.length - 1 ) { | ||
| this.scriptElements[ index + 1 ].focus(); | ||
| } | ||
| }, | ||
|
|
@@ -226,8 +230,8 @@ | |
| this.$set( | ||
| 'currentCommand', | ||
| { | ||
| script : script, | ||
| options : options | ||
| script, | ||
| options | ||
| } | ||
| ); | ||
| } | ||
|
|
@@ -241,7 +245,7 @@ | |
|
|
||
| vuex : { | ||
| actions : { | ||
| removeRepoAction : removeRepoAction | ||
| removeRepoAction | ||
| }, | ||
|
|
||
| getters : { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cache the potentially "expensive" value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jap... totally with you here. :)