|
|
|
@ -493,18 +493,22 @@ export default Backbone.Model.extend({ |
|
|
|
|
|
|
|
/** |
|
|
|
* Returns HTML built inside canvas |
|
|
|
* @return {string} HTML string |
|
|
|
* @param {Object} [opts={}] Options |
|
|
|
* @returns {string} HTML string |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
getHtml() { |
|
|
|
getHtml(opts = {}) { |
|
|
|
const config = this.config; |
|
|
|
const { optsHtml } = config; |
|
|
|
const exportWrapper = config.exportWrapper; |
|
|
|
const wrapperIsBody = config.wrapperIsBody; |
|
|
|
const js = config.jsInHtml ? this.getJs() : ''; |
|
|
|
var wrp = this.get('DomComponents').getComponent(); |
|
|
|
var html = this.get('CodeManager').getCode(wrp, 'html', { |
|
|
|
exportWrapper, |
|
|
|
wrapperIsBody |
|
|
|
wrapperIsBody, |
|
|
|
...optsHtml, |
|
|
|
...opts |
|
|
|
}); |
|
|
|
html += js ? `<script>${js}</script>` : ''; |
|
|
|
return html; |
|
|
|
@ -513,11 +517,12 @@ export default Backbone.Model.extend({ |
|
|
|
/** |
|
|
|
* Returns CSS built inside canvas |
|
|
|
* @param {Object} [opts={}] Options |
|
|
|
* @return {string} CSS string |
|
|
|
* @returns {string} CSS string |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
getCss(opts = {}) { |
|
|
|
const config = this.config; |
|
|
|
const { optsCss } = config; |
|
|
|
const wrapperIsBody = config.wrapperIsBody; |
|
|
|
const avoidProt = opts.avoidProtected; |
|
|
|
const keepUnusedStyles = !isUndefined(opts.keepUnusedStyles) |
|
|
|
@ -532,7 +537,8 @@ export default Backbone.Model.extend({ |
|
|
|
this.get('CodeManager').getCode(wrp, 'css', { |
|
|
|
cssc, |
|
|
|
wrapperIsBody, |
|
|
|
keepUnusedStyles |
|
|
|
keepUnusedStyles, |
|
|
|
...optsCss |
|
|
|
}) |
|
|
|
); |
|
|
|
}, |
|
|
|
|