Browse Source

Update navigator and parser

pull/36/head
Artur Arseniev 10 years ago
parent
commit
e9e44e657c
  1. 1
      src/dom_components/view/ComponentTextView.js
  2. 4
      src/navigator/view/ItemsView.js
  3. 2
      src/parser/config/config.js
  4. 10
      src/parser/model/ParserHtml.js

1
src/dom_components/view/ComponentTextView.js

@ -26,6 +26,7 @@ define(['backbone', './ComponentView'],
comps.reset(null, opts);
comps.add(this.$el.html(), opts);
this.model.set('content', '');
comps.trigger('resetNavigator');
this.render();
},

4
src/navigator/view/ItemsView.js

@ -12,8 +12,8 @@ define(['backbone','./ItemView'],
this.sorter = o.sorter || {};
this.pfx = o.config.stylePrefix;
this.parent = o.parent;
this.listenTo( this.collection, 'add', this.addTo );
this.listenTo( this.collection, 'reset', this.render );
this.listenTo(this.collection, 'add', this.addTo);
this.listenTo(this.collection, 'reset resetNavigator', this.render);
this.className = this.pfx + 'items';
if(!this.parent)

2
src/parser/config/config.js

@ -4,4 +4,4 @@ define(function () {
textTags: ['br', 'b', 'i', 'u'],
};
});
});

10
src/parser/model/ParserHtml.js

@ -145,18 +145,16 @@ define(function(require) {
*/
// Check if it's a text node and if it could be moved to the prevous model
/*
if(c.textTags.indexOf(model.tagName) >= 0){
if(prevIsText){
prevSib.content += node.outerHTML;
continue;
}else{
model = {
type: 'text',
tagName: TEXT_NODE,
content: node.outerHTML,
};
console.log(model);
model = { type: 'text', tagName: TEXT_NODE, content: node.outerHTML,};
}
}
}*/
// If tagName is still empty and is not a textnode, do not push it
if(!model.tagName && model.type != 'textnode')

Loading…
Cancel
Save