style editor-accessibility

This commit is contained in:
MathuraMG 2016-08-11 15:38:32 -04:00
parent d789c9a8f3
commit 4806b83d1f
4 changed files with 26 additions and 16 deletions

View file

@ -6,6 +6,7 @@ class EditorAccessibility extends React.Component {
}
render() {
let messages = [];
if (this.props.lintMessages.length > 0) {
for (let i = 0; i < this.props.lintMessages.length; i++) {
messages.push(
<li>
@ -15,9 +16,14 @@ class EditorAccessibility extends React.Component {
</li>
);
}
} else {
messages.push(
<p tabIndex="0"> There are no lint messages </p>
);
}
return (
<div>
<p className="editor-linenumber" aria-live="assertive" id="editor-linenumber">line - {this.props.lineNo}</p>
<div className="editor-accessibility">
<p className="editor-linenumber" aria-live="polite" id="editor-linenumber"> {this.props.lineNo} </p>
<ul className="editor-lintmessages" id="editor-lintmessages" title="lint messages">
{messages}
</ul>
@ -28,7 +34,7 @@ class EditorAccessibility extends React.Component {
EditorAccessibility.propTypes = {
lintMessages: PropTypes.array.isRequired,
lineNo: PropTypes.number.isRequired,
lineNo: PropTypes.string.isRequired,
};
export default EditorAccessibility;

View file

@ -106,10 +106,6 @@ class IDEView extends React.Component {
updateFileName={this.props.updateFileName}
/>
<div className="editor-console-container">
<EditorAccessibility
lintMessages={this.props.editorAccessibility.lintMessages}
lineNo={this.props.editorAccessibility.lineNo}
/>
<Editor
lintWarning={this.props.preferences.lintWarning}
lintMessages={this.props.editorAccessibility.lintMessages}
@ -123,6 +119,10 @@ class IDEView extends React.Component {
isTabIndent={this.props.preferences.isTabIndent}
files={this.props.files}
/>
<EditorAccessibility
lintMessages={this.props.editorAccessibility.lintMessages}
lineNo={this.props.editorAccessibility.lineNo}
/>
<Console
consoleEvent={this.props.ide.consoleEvent}
isPlaying={this.props.ide.isPlaying}
@ -194,7 +194,7 @@ IDEView.propTypes = {
openPreferences: PropTypes.func.isRequired,
editorAccessibility: PropTypes.shape({
lintMessages: PropTypes.array.isRequired,
lineNo: PropTypes.number.isRequired
lineNo: PropTypes.string.isRequired
}).isRequired,
updateLintMessage: PropTypes.func.isRequired,
clearLintMessage: PropTypes.func.isRequired,

View file

@ -1,7 +1,7 @@
import * as ActionTypes from '../../../constants';
const initialState = {
lineNo: 0,
lineNo: 'line',
lintMessages: []
};
@ -15,7 +15,7 @@ const editorAccessibility = (state = initialState, action) => {
case ActionTypes.CLEAR_LINT_MESSAGE:
return Object.assign({}, state, { lintMessages: [] });
case ActionTypes.UPDATE_LINENUMBER:
return Object.assign({}, state, { lineNo: action.lineNo });
return Object.assign({}, state, { lineNo: `line ${action.lineNo}` });
default:
return state;
}

View file

@ -27,6 +27,10 @@
position: absolute;
}
.editor-accessibility {
@extend %hidden-element;
}
.preview-frame {
flex: 1 0 0px;
min-height: 100%;