Browse Source

Add `avoidProtected` option in `getCss()`

pull/600/head
Artur Arseniev 8 years ago
parent
commit
64d2632ef3
  1. 9
      src/editor/index.js
  2. 10
      src/editor/model/Editor.js

9
src/editor/index.js

@ -244,16 +244,17 @@ module.exports = config => {
* Returns HTML built inside canvas
* @return {string} HTML string
*/
getHtml() {
return em.getHtml();
getHtml(opts) {
return em.getHtml(opts);
},
/**
* Returns CSS built inside canvas
* @param {Object} [opts={}] Options
* @return {string} CSS string
*/
getCss() {
return em.getCss();
getCss(opts) {
return em.getCss(opts);
},
/**

10
src/editor/model/Editor.js

@ -485,15 +485,17 @@ module.exports = Backbone.Model.extend({
/**
* Returns CSS built inside canvas
* @param {Object} [opts={}] Options
* @return {string} CSS string
* @private
*/
getCss() {
getCss(opts = {}) {
const config = this.config;
const wrappesIsBody = config.wrappesIsBody;
var cssc = this.get('CssComposer');
var wrp = this.get('DomComponents').getComponent();
var protCss = config.protectedCss;
const avoidProt = opts.avoidProtected;
const cssc = this.get('CssComposer');
const wrp = this.get('DomComponents').getComponent();
const protCss = !avoidProt ? config.protectedCss : '';
return protCss + this.get('CodeManager').getCode(wrp, 'css', {
cssc, wrappesIsBody

Loading…
Cancel
Save