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
+24 -12
View File
@@ -208,7 +208,12 @@ var _Dot = {
if(!vn.state.opened) vn.state.opened = 1;
}
}, m.trust(this.nested ? this.breadcrumb : this.title)),
m('p', {'class':'summary'}, m.trust(this.summary))
m('p', {
'class':'summary',
onclick(e){
if(!vn.state.opened) vn.state.opened = 1;
}
}, m.trust(this.summary))
]
);
},
@@ -242,15 +247,17 @@ var _Child = {
// onbeforeupdate(vn, old){},
view(vn){
return [
m(_Dot, vn.attrs),
!_dbs.active_type_filter || _dbs.active_type_filter == vn.attrs.dottype
? m(_Dot, vn.attrs)
: null,
// add children
typeof vn.attrs.childs !== 'undefined'
? vn.attrs.childs.map(c => {
c.lang = vn.attrs.lang;
c.level = vn.attrs.level + 1;
return m(_Child, c);
})
: null
? vn.attrs.childs.map(c => {
c.lang = vn.attrs.lang;
c.level = vn.attrs.level + 1;
return m(_Child, c);
})
: null
];
}
};
@@ -266,9 +273,11 @@ var _Enonce = {
view(vn){
vn.attrs.level = 0;
return [
!_dbs.active_type_filter || _dbs.active_type_filter == vn.attrs.dottype
// create dot
m(_Dot, vn.attrs),
// addd children
? m(_Dot, vn.attrs)
: null,
// add children
vn.attrs.childs.map(c => {
c.lang = vn.attrs.lang;
c.level = 1;
@@ -307,7 +316,9 @@ var _Part = {
switch (e.type) {
case "title":
// handle titles
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
@@ -357,7 +368,8 @@ module.exports = {
console.log('Connection, onbeforeupdate old',old, 'vn',vn);
},
view(vn){
console.log('_ModeConnections view', vn.attrs.lang);
// console.log('_ModeConnections view', vn.attrs.lang);
console.log('_dbs.active_type_filter : ', _dbs.active_type_filter);
return m('main', {id:"content", 'class':'mode-connections'}, _dbs.data[vn.attrs.lang].map(p => {
p.lang = vn.attrs.lang;
if(p.id == 'intro'){