added filters by text type

This commit is contained in:
2018-09-18 12:21:57 +02:00
parent 30443960ab
commit 2eeceb6a60
10 changed files with 190 additions and 61 deletions
+35 -24
View File
@@ -224,25 +224,28 @@ var _Item = {
// 'class':'item'+(this.nested ? ' nested':'')
'class' :`item${this.nested ? ' nested':''} ${this.dottype}`
},
[
// create title node (only if not nested)
!this.nested
? m("h3", {
// 'ref':vn.attrs.href,
// onclick(e){ WHAT IS THIS STATE ACTIVE ???
// vn.state.active = vn.state.active ? 0 : 1;
// }
}, m.trust(markdown.renderInline(this.type)))
: null,
// create text node
typeof vn.attrs.text !== "undefined"
? m(_Text, {'text':this.text, 'id':this.id, 'lang':vn.attrs.lang})
: null,
// add children (only if not nested)
// typeof vn.attrs.childs !== 'undefined' && !this.nested
// ? vn.attrs.childs.map(c => { return m(_Item, c); })
// : null
]
// filter by type if active filter
!_dbs.active_type_filter || _dbs.active_type_filter == vn.attrs.dottype
? [
// create title node (only if not nested)
!this.nested
? m("h3", {
// 'ref':vn.attrs.href,
// onclick(e){ WHAT IS THIS STATE ACTIVE ???
// vn.state.active = vn.state.active ? 0 : 1;
// }
}, m.trust(markdown.renderInline(this.type)))
: null,
// create text node
typeof vn.attrs.text !== "undefined"
? m(_Text, {'text':this.text, 'id':this.id, 'lang':vn.attrs.lang})
: null,
// add children (only if not nested)
// typeof vn.attrs.childs !== 'undefined' && !this.nested
// ? vn.attrs.childs.map(c => { return m(_Item, c); })
// : null
]
:null
)
}
};
@@ -287,10 +290,15 @@ var _Enonce = {
'class' :`enonce${vn.attrs.nested ? ' nested':''} ${this.dottype}`
},
[
// create title node (only if not nested)
!vn.attrs.nested ? m("h2", {}, m.trust(markdown.renderInline(this.title))) : null,
// create text node
m(_Text, {'text':vn.attrs.text, 'id':vn.attrs.id, 'nested':vn.attrs.nested}),
// filter by type if active filter (but let map on children)
!_dbs.active_type_filter || _dbs.active_type_filter == vn.attrs.dottype
// create title node (only if not nested)
? !vn.attrs.nested ? m("h2", {}, m.trust(markdown.renderInline(this.title))) : null
: null,
!_dbs.active_type_filter || _dbs.active_type_filter == vn.attrs.dottype
// create text node
? m(_Text, {'text':vn.attrs.text, 'id':vn.attrs.id, 'nested':vn.attrs.nested})
: null,
// add children (only if not nested)
typeof vn.attrs.childs !== 'undefined' && !vn.attrs.nested
? vn.attrs.childs.map(c => {
@@ -335,7 +343,9 @@ var _Part = {
case "title":
// handle titles
// console.log('title');
return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
return !_dbs.active_type_filter
? m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)))
: null ;
break;
case "filet":
// handle filets
@@ -394,6 +404,7 @@ module.exports = {
// },
view(vn){
// console.log('_ModeText view', vn.attrs.lang);
console.log('_dbs.active_type_filter : ', _dbs.active_type_filter);
return m('main', {id:"content", 'class':'mode-text'}, _dbs.data[vn.attrs.lang].map((p) => {
// console.log("MAP _dbs", p);
p.lang = vn.attrs.lang;