Browse Source

Update navigator items

pull/261/head
Artur Arseniev 9 years ago
parent
commit
a97bdedee0
  1. 4
      dist/grapes.min.js
  2. 2
      package.json
  3. 2
      src/dom_components/model/Component.js
  4. 8
      src/navigator/view/ItemView.js

4
dist/grapes.min.js

File diff suppressed because one or more lines are too long

2
package.json

@ -1,7 +1,7 @@
{ {
"name": "grapesjs", "name": "grapesjs",
"description": "Free and Open Source Web Builder Framework", "description": "Free and Open Source Web Builder Framework",
"version": "0.9.22", "version": "0.9.23",
"author": "Artur Arseniev", "author": "Artur Arseniev",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"homepage": "http://grapesjs.com", "homepage": "http://grapesjs.com",

2
src/dom_components/model/Component.js

@ -112,8 +112,6 @@ module.exports = Backbone.Model.extend(Styleable).extend({
this.set('attributes', this.get('attributes') || {}); this.set('attributes', this.get('attributes') || {});
this.listenTo(this, 'change:script', this.scriptUpdated); this.listenTo(this, 'change:script', this.scriptUpdated);
this.listenTo(this, 'change:traits', this.traitsUpdated); this.listenTo(this, 'change:traits', this.traitsUpdated);
//this.defaultCl = this.normalizeClasses(this.get('classes') || this.config.classes || []);
//this.set('classes', new Selectors(this.defaultCl));
this.loadTraits(); this.loadTraits();
this.initClasses(); this.initClasses();
this.initComponents(); this.initComponents();

8
src/navigator/view/ItemView.js

@ -38,7 +38,7 @@ module.exports = Backbone.View.extend({
this.pfx = this.config.stylePrefix; this.pfx = this.config.stylePrefix;
if(typeof this.model.get('open') == 'undefined') if(typeof this.model.get('open') == 'undefined')
this.model.set('open',false); this.model.set('open',false);
this.listenTo(this.model.components, 'remove add change reset', this.checkChildren); this.listenTo(this.model.get('components'), 'remove add change reset', this.checkChildren);
this.listenTo(this.model, 'destroy remove', this.remove); this.listenTo(this.model, 'destroy remove', this.remove);
this.listenTo(this.model, 'change:status', this.updateStatus); this.listenTo(this.model, 'change:status', this.updateStatus);
this.listenTo(this.model, 'change:open', this.updateOpening); this.listenTo(this.model, 'change:open', this.updateOpening);
@ -122,7 +122,7 @@ module.exports = Backbone.View.extend({
toggleOpening(e) { toggleOpening(e) {
e.stopPropagation(); e.stopPropagation();
if(!this.model.components.length) if(!this.model.get('components').length)
return; return;
this.model.set('open', !this.model.get('open') ); this.model.set('open', !this.model.get('open') );
@ -242,7 +242,7 @@ module.exports = Backbone.View.extend({
*/ */
countChildren(model) { countChildren(model) {
var count = 0; var count = 0;
model.components.each(function(m){ model.get('components').each(function(m){
var isCountable = this.opt.isCountable; var isCountable = this.opt.isCountable;
var hide = this.config.hideTextnode; var hide = this.config.hideTextnode;
if(isCountable && !isCountable(m, hide)) if(isCountable && !isCountable(m, hide))
@ -285,7 +285,7 @@ module.exports = Backbone.View.extend({
if(typeof ItemsView == 'undefined') if(typeof ItemsView == 'undefined')
ItemsView = require('./ItemsView'); ItemsView = require('./ItemsView');
this.$components = new ItemsView({ this.$components = new ItemsView({
collection: model.components, collection: model.get('components'),
config: this.config, config: this.config,
sorter: this.sorter, sorter: this.sorter,
opened: this.opt.opened, opened: this.opt.opened,

Loading…
Cancel
Save