mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 18:32:40 +00:00
Lint
This commit is contained in:
@@ -85,16 +85,15 @@ const Editor = createClass({
|
|||||||
editorTheme : editorTheme
|
editorTheme : editorTheme
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const snippetBar = document.querySelector('.editor > .snippetBar');
|
const snippetBar = document.querySelector('.editor > .snippetBar');
|
||||||
if (!snippetBar) return;
|
if (!snippetBar) return;
|
||||||
|
|
||||||
this.resizeObserver = new ResizeObserver(entries => {
|
this.resizeObserver = new ResizeObserver(entries => {
|
||||||
const height = document.querySelector('.editor > .snippetBar').offsetHeight;
|
const height = document.querySelector('.editor > .snippetBar').offsetHeight;
|
||||||
this.setState({ snippetBarHeight: height });
|
this.setState({ snippetBarHeight: height });
|
||||||
console.log('setting state to ', height );
|
});
|
||||||
});
|
|
||||||
|
|
||||||
this.resizeObserver.observe(snippetBar);
|
this.resizeObserver.observe(snippetBar);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidUpdate : function(prevProps, prevState, snapshot) {
|
componentDidUpdate : function(prevProps, prevState, snapshot) {
|
||||||
@@ -118,7 +117,7 @@ const Editor = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
if (this.resizeObserver) this.resizeObserver.disconnect();
|
if (this.resizeObserver) this.resizeObserver.disconnect();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleControlKeys : function(e){
|
handleControlKeys : function(e){
|
||||||
@@ -436,7 +435,6 @@ const Editor = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
renderEditor : function(){
|
renderEditor : function(){
|
||||||
console.log('state at rendering is: ',this.state.snippetBarHeight);
|
|
||||||
if(this.isText()){
|
if(this.isText()){
|
||||||
return <>
|
return <>
|
||||||
<CodeEditor key='codeEditor'
|
<CodeEditor key='codeEditor'
|
||||||
|
|||||||
Reference in New Issue
Block a user