Browse Source

Clean ExportTemplate command

pull/1069/head
Artur Arseniev 9 years ago
parent
commit
dbb81a2b62
  1. 2
      src/commands/view/ExportTemplate.js
  2. 4
      src/editor/config/config.js
  3. 5
      src/editor/model/Editor.js

2
src/commands/view/ExportTemplate.js

@ -22,7 +22,7 @@ module.exports = {
modal.setContent(this.$editors); modal.setContent(this.$editors);
modal.open(); modal.open();
this.htmlEditor.setContent(editor.getHtml()); this.htmlEditor.setContent(editor.getHtml());
this.cssEditor.setContent(editor.getCss({ dumpUnusedSelectors: 1 })); this.cssEditor.setContent(editor.getCss());
}, },
stop(editor) { stop(editor) {

4
src/editor/config/config.js

@ -281,6 +281,6 @@ module.exports = {
// Texts // Texts
textViewCode: 'Code', textViewCode: 'Code',
// Dump unused styles within the editor. // Dump unused styles within the editor
dumpUnusedStyles: false dumpUnusedStyles: 0
}; };

5
src/editor/model/Editor.js

@ -305,8 +305,9 @@ module.exports = Backbone.Model.extend({
const config = this.config; const config = this.config;
const wrappesIsBody = config.wrappesIsBody; const wrappesIsBody = config.wrappesIsBody;
const avoidProt = opts.avoidProtected; const avoidProt = opts.avoidProtected;
const dumpUnusedStyles = const dumpUnusedStyles = !isUndefined(opts.dumpUnusedStyles)
opts.dumpUnusedStyles || this.config.dumpUnusedStyles; ? opts.dumpUnusedStyles
: config.dumpUnusedStyles;
const cssc = this.get('CssComposer'); const cssc = this.get('CssComposer');
const wrp = this.get('DomComponents').getComponent(); const wrp = this.get('DomComponents').getComponent();
const protCss = !avoidProt ? config.protectedCss : ''; const protCss = !avoidProt ? config.protectedCss : '';

Loading…
Cancel
Save