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",
"description": "Free and Open Source Web Builder Framework",
"version": "0.9.22",
"version": "0.9.23",
"author": "Artur Arseniev",
"license": "BSD-3-Clause",
"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.listenTo(this, 'change:script', this.scriptUpdated);
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.initClasses();
this.initComponents();

8
src/navigator/view/ItemView.js

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

Loading…
Cancel
Save