Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Merge branch 'dev-252' into 'master'
Browse files Browse the repository at this point in the history
Add devices buttons focusable #252

See merge request !94
  • Loading branch information
damianprzygodzki committed Feb 13, 2017
2 parents 99d0f88 + 3b6eb6e commit f4820a1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/assets/css/focus.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
.btn:focus,
button:focus {
outline: 0;
border: 1px solid $brand-font-color;
}
11 changes: 0 additions & 11 deletions src/components/app/SelectionAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ class SelectionAttributes extends Component {
});
}

moveToDevice = (e) => {
switch(e.key) {
case "Shift":
e.preventDefault();
//TO DO
break;
}
}

getTabId = (item) => {
return item && item[0].readonly ? -1 : 1;

Expand All @@ -84,8 +75,6 @@ class SelectionAttributes extends Component {
DLWrapperHandleChange, DLWrapperHandlePatch, entity, setClickOutsideLock
} = this.props;

const lastItem = DLWrapperLayout.length-1;

return (
<div>
<div className="attributes-selector-header">
Expand Down
2 changes: 2 additions & 0 deletions src/components/widget/Devices/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Device extends Component {

render() {
const {value, index, isMore} = this.state;
const {tabIndex} = this.props;

if(!!value){
return (
Expand All @@ -49,6 +50,7 @@ class Device extends Component {
(isMore ? "btn-flagged ": "")
}
onClick={this.handleClick}
tabIndex={tabIndex}
>
{isMore && <span className="btn-flag">{index + 1}</span>}
{value}
Expand Down
3 changes: 2 additions & 1 deletion src/components/widget/Devices/DevicesWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DevicesWidget extends Component {
}

render() {
const {devices, handleChange} = this.props;
const {devices, handleChange, tabIndex} = this.props;
const isMore = devices.length > 1;

return (
Expand All @@ -20,6 +20,7 @@ class DevicesWidget extends Component {
index={index}
handleChange={handleChange}
isMore={isMore}
tabIndex={tabIndex}
/>
)}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/widget/RawWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ class RawWidget extends Component {
tabIndex, handlePatch
} = this.props;


if(widgetData[0].displayed && widgetData[0].displayed === true){
return (
<div className={
Expand Down Expand Up @@ -612,6 +613,7 @@ class RawWidget extends Component {
{fields[0].devices && !widgetData[0].readonly &&
<DevicesWidget
devices={fields[0].devices}
tabIndex={1}
handleChange={(value) =>
handlePatch && handlePatch(fields[0].field, value)
}
Expand Down

0 comments on commit f4820a1

Please sign in to comment.