style editor-accessibility
This commit is contained in:
parent
d789c9a8f3
commit
4806b83d1f
4 changed files with 26 additions and 16 deletions
|
@ -6,6 +6,7 @@ class EditorAccessibility extends React.Component {
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
let messages = [];
|
let messages = [];
|
||||||
|
if (this.props.lintMessages.length > 0) {
|
||||||
for (let i = 0; i < this.props.lintMessages.length; i++) {
|
for (let i = 0; i < this.props.lintMessages.length; i++) {
|
||||||
messages.push(
|
messages.push(
|
||||||
<li>
|
<li>
|
||||||
|
@ -15,9 +16,14 @@ class EditorAccessibility extends React.Component {
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
messages.push(
|
||||||
|
<p tabIndex="0"> There are no lint messages </p>
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="editor-accessibility">
|
||||||
<p className="editor-linenumber" aria-live="assertive" id="editor-linenumber">line - {this.props.lineNo}</p>
|
<p className="editor-linenumber" aria-live="polite" id="editor-linenumber"> {this.props.lineNo} </p>
|
||||||
<ul className="editor-lintmessages" id="editor-lintmessages" title="lint messages">
|
<ul className="editor-lintmessages" id="editor-lintmessages" title="lint messages">
|
||||||
{messages}
|
{messages}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -28,7 +34,7 @@ class EditorAccessibility extends React.Component {
|
||||||
|
|
||||||
EditorAccessibility.propTypes = {
|
EditorAccessibility.propTypes = {
|
||||||
lintMessages: PropTypes.array.isRequired,
|
lintMessages: PropTypes.array.isRequired,
|
||||||
lineNo: PropTypes.number.isRequired,
|
lineNo: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EditorAccessibility;
|
export default EditorAccessibility;
|
||||||
|
|
|
@ -106,10 +106,6 @@ class IDEView extends React.Component {
|
||||||
updateFileName={this.props.updateFileName}
|
updateFileName={this.props.updateFileName}
|
||||||
/>
|
/>
|
||||||
<div className="editor-console-container">
|
<div className="editor-console-container">
|
||||||
<EditorAccessibility
|
|
||||||
lintMessages={this.props.editorAccessibility.lintMessages}
|
|
||||||
lineNo={this.props.editorAccessibility.lineNo}
|
|
||||||
/>
|
|
||||||
<Editor
|
<Editor
|
||||||
lintWarning={this.props.preferences.lintWarning}
|
lintWarning={this.props.preferences.lintWarning}
|
||||||
lintMessages={this.props.editorAccessibility.lintMessages}
|
lintMessages={this.props.editorAccessibility.lintMessages}
|
||||||
|
@ -123,6 +119,10 @@ class IDEView extends React.Component {
|
||||||
isTabIndent={this.props.preferences.isTabIndent}
|
isTabIndent={this.props.preferences.isTabIndent}
|
||||||
files={this.props.files}
|
files={this.props.files}
|
||||||
/>
|
/>
|
||||||
|
<EditorAccessibility
|
||||||
|
lintMessages={this.props.editorAccessibility.lintMessages}
|
||||||
|
lineNo={this.props.editorAccessibility.lineNo}
|
||||||
|
/>
|
||||||
<Console
|
<Console
|
||||||
consoleEvent={this.props.ide.consoleEvent}
|
consoleEvent={this.props.ide.consoleEvent}
|
||||||
isPlaying={this.props.ide.isPlaying}
|
isPlaying={this.props.ide.isPlaying}
|
||||||
|
@ -194,7 +194,7 @@ IDEView.propTypes = {
|
||||||
openPreferences: PropTypes.func.isRequired,
|
openPreferences: PropTypes.func.isRequired,
|
||||||
editorAccessibility: PropTypes.shape({
|
editorAccessibility: PropTypes.shape({
|
||||||
lintMessages: PropTypes.array.isRequired,
|
lintMessages: PropTypes.array.isRequired,
|
||||||
lineNo: PropTypes.number.isRequired
|
lineNo: PropTypes.string.isRequired
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
updateLintMessage: PropTypes.func.isRequired,
|
updateLintMessage: PropTypes.func.isRequired,
|
||||||
clearLintMessage: PropTypes.func.isRequired,
|
clearLintMessage: PropTypes.func.isRequired,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as ActionTypes from '../../../constants';
|
import * as ActionTypes from '../../../constants';
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
lineNo: 0,
|
lineNo: 'line',
|
||||||
lintMessages: []
|
lintMessages: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ const editorAccessibility = (state = initialState, action) => {
|
||||||
case ActionTypes.CLEAR_LINT_MESSAGE:
|
case ActionTypes.CLEAR_LINT_MESSAGE:
|
||||||
return Object.assign({}, state, { lintMessages: [] });
|
return Object.assign({}, state, { lintMessages: [] });
|
||||||
case ActionTypes.UPDATE_LINENUMBER:
|
case ActionTypes.UPDATE_LINENUMBER:
|
||||||
return Object.assign({}, state, { lineNo: action.lineNo });
|
return Object.assign({}, state, { lineNo: `line ${action.lineNo}` });
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,10 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editor-accessibility {
|
||||||
|
@extend %hidden-element;
|
||||||
|
}
|
||||||
|
|
||||||
.preview-frame {
|
.preview-frame {
|
||||||
flex: 1 0 0px;
|
flex: 1 0 0px;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
|
Loading…
Reference in a new issue