Last active
November 8, 2018 18:24
-
-
Save dhindurthy/aff65a99bc0c429dab714a089fb70477 to your computer and use it in GitHub Desktop.
tab vs arrow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
elementId: 'tva-list', | |
didRender(){ | |
$('#tva-list').children().children().first().focus(); | |
}, | |
keyDown: function(event){ | |
let target = this.$(event.target); | |
let elementId = this.get('elementId'); | |
if(event.keyCode==40){ | |
target.next().focus(); | |
} else if (event.keyCode==38){ | |
target.prev().focus(); | |
} else if (!event.shiftKey && event.keyCode == 9 ) { | |
event.preventDefault(); | |
$('#tva-list').next().focus(); | |
} else if (event.shiftKey && event.keyCode == 9){ | |
event.preventDefault(); | |
target.parent().prev().focus(); | |
if (event.target.tagName === "LI"){ | |
this.set('showList', false); | |
} | |
} | |
}, | |
showList: false, | |
actions:{ | |
toggleList(){ | |
this.toggleProperty('showList'); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
ul { | |
list-style:none; | |
border: 0.05px solid grey; | |
width: 200px; | |
margin: 15px; | |
margin-top: 5px; | |
margin-left: 0; | |
padding: 5px; | |
padding-left: 10px; | |
} | |
li { | |
padding:2px; | |
} | |
input, label { | |
display: block; | |
margin: 45px; | |
margin-left: 0; | |
} | |
input { | |
margin-top: 0; | |
} | |
label { | |
margin-bottom: 0; | |
} | |
li:focus { | |
border: none; | |
background-color: #e35b44; | |
color: white; | |
} | |
input:focus { | |
//border: 2px solid green; | |
color: white; | |
background-color: #e35b44; | |
} | |
button:focus { | |
//border: 2px solid green; | |
color: white; | |
background-color: #e35b44; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment