Skip to content

Commit

Permalink
Implement styleWithCSS option
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredreich committed Jul 15, 2017
1 parent 5d4441d commit a0c2260
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ <h3>HTML output:</h3>
document.getElementById('text-output').innerHTML = html
document.getElementById('html-output').textContent = html
},
root: document.getElementById('pell')
root: document.getElementById('pell'),
styleWithCSS: true
})
</script>

Expand Down
2 changes: 2 additions & 0 deletions dist/pell.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ var init = function init(settings) {
};
settings.root.appendChild(editor);

if (settings.styleWithCSS) execute('styleWithCSS');

settings.actions.forEach(function (action) {
var button = document.createElement('button');
button.className = settings.classes.button;
Expand Down
2 changes: 1 addition & 1 deletion dist/pell.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/pell.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ export const init = settings => {
editor.oninput = event => settings.onChange && settings.onChange(event.target.innerHTML)
settings.root.appendChild(editor)

if (settings.styleWithCSS) execute('styleWithCSS')

settings.actions.forEach(action => {
const button = document.createElement('button')
button.className = settings.classes.button
Expand Down

0 comments on commit a0c2260

Please sign in to comment.