1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-25 07:51:12 +02:00

remove dom access

This commit is contained in:
Kushagra Gour
2019-07-16 22:03:05 +05:30
parent 9558dff0b1
commit 73e89f7a89
2 changed files with 13 additions and 16 deletions

View File

@@ -462,9 +462,6 @@ export default class ContentWrap extends Component {
this.props.onCodeModeChange('css', value); this.props.onCodeModeChange('css', value);
this.props.currentItem.cssMode = value; this.props.currentItem.cssMode = value;
this.cm.css.setOption('readOnly', modes[value].cmDisable); this.cm.css.setOption('readOnly', modes[value].cmDisable);
window.cssSettingsBtn.classList[
modes[value].hasSettings ? 'remove' : 'add'
]('hide');
this.cm.css.setLanguage(value); this.cm.css.setLanguage(value);
return handleModeRequirements(value); return handleModeRequirements(value);
} }
@@ -733,17 +730,19 @@ export default class ContentWrap extends Component {
</select> </select>
</label> </label>
<div class="code-wrap__header-right-options"> <div class="code-wrap__header-right-options">
<a {modes[this.props.currentItem.cssMode || 'css'].hasSettings && (
href="#" <a
id="cssSettingsBtn" href="#"
title="Atomic CSS configuration" id="cssSettingsBtn"
onClick={this.cssSettingsBtnClickHandler.bind(this)} title="Atomic CSS configuration"
class="code-wrap__header-btn hide" onClick={this.cssSettingsBtnClickHandler.bind(this)}
> class="code-wrap__header-btn"
<svg> >
<use xlinkHref="#settings-icon" /> <svg>
</svg> <use xlinkHref="#settings-icon" />
</a> </svg>
</a>
)}
<a <a
class="code-wrap__header-btn " class="code-wrap__header-btn "
title="Format code" title="Format code"

View File

@@ -286,8 +286,6 @@ export default class App extends Component {
this.setState(prevState => { this.setState(prevState => {
const newCount = prevState.unsavedEditCount + 1; const newCount = prevState.unsavedEditCount + 1;
console.log('checking on ', newCount);
if ( if (
newCount % UNSAVED_WARNING_COUNT === 0 && newCount % UNSAVED_WARNING_COUNT === 0 &&
newCount >= UNSAVED_WARNING_COUNT newCount >= UNSAVED_WARNING_COUNT