Browse Source

Add forceClass option in the way to prevent class creation

pull/79/merge
Artur Arseniev 9 years ago
parent
commit
a73f951a79
  1. 1
      index.html
  2. 3
      src/dom_components/model/Components.js
  3. 4
      src/editor/config/config.js

1
index.html

@ -14,6 +14,7 @@
<div id="gjs" style="height:0px; overflow:hidden">
<header class="header-banner">
<div style="color:red; width: 300px;">TEST</div>
<div class="container-width">
<!--
<table>

3
src/dom_components/model/Components.js

@ -64,8 +64,9 @@ define([ 'backbone', 'require'],
onAdd: function(model, c, opts){
var style = model.get('style');
var em = this.editor;
if(!_.isEmpty(style) && this.editor){
if(!_.isEmpty(style) && em && em.get('Config').forceClass){
var cssC = this.editor.get('CssComposer');
var newClass = this.editor.get('SelectorManager').add(model.cid);
model.set({style:{}});

4
src/editor/config/config.js

@ -29,6 +29,10 @@ define(function () {
// Return JS of components inside HTML from 'editor.getHtml()'
jsInHtml: true,
// On creation of a new Component (via object), if the 'style' attribute is not
// empty, all those roles will be moved in its new class
forceClass: true,
// Height for the editor container
height: '900px',

Loading…
Cancel
Save