var toret;
if(parent.is('list')) {
- listElement.wrapWithNodeElement({tag: 'div', klass: 'item'});
+ var item = listElement.wrapWithNodeElement({tag: 'div', klass: 'item'});
+ item.exec('toggleBullet', false);
toret = listElement.parent();
} else {
toret = listElement;
return this.parents().some(function(parent) {
return parent.is('list');
});
+ },
+
+ exec: function(method) {
+ var manager = this.data('_wlxmlManager');
+ if(manager[method])
+ return manager[method].apply(manager, Array.prototype.slice.call(arguments, 1));
}
});
managers.set('aside', 'footnote', FootnoteManager);
+var ListItemManager = function(wlxmlElement) {
+ this.el = wlxmlElement;
+};
+$.extend(ListItemManager.prototype, {
+ setup: function() {
+ this.el.clearWidgets();
+ this.el.addWidget(widgets.labelWidget(this.el.tag(), this.el.klass()));
+ this.el.documentElement._container().css({display: 'list-item'});
+ },
+ toggleBullet: function(toggle) {
+ this.el.documentElement._container().css({display : toggle ? 'list-item' : 'block'});
+ }
+});
+managers.set('div', 'item', ListItemManager);
+
return {
getFor: function(documentElement) {
var wlxmlElement = new DocumentElementWrapper(documentElement);