Created
June 27, 2018 10:28
-
-
Save levvsha/b2216700e9b5e97278a7b7101e4a9b78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
import converter from './converter'; | |
... | |
logMarkup() { | |
const markup = converter(this.state.editorState.getCurrentContent()); // <-- [1] | |
document.getElementById('js-markup-container').innerHTML = markup; | |
console.log('markup ==> ', markup); // <-- [2] | |
const sliders = document.querySelectorAll('.js-slider');// <-- [3] | |
_forEach(sliders, slider => { | |
const description = slider.innerHTML; | |
slider.innerHTML = ''; // eslint-disable-line | |
render(( <-- [4] | |
<ContentSlider | |
slides={JSON.parse(slider.getAttribute('data-slides').replace(/'/g, '"'))} | |
descriptionHtml={description} | |
/> | |
), slider); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment