@@ -69,24 +69,34 @@ const replyButton = (model, post) => h('a.btn.btn-primary', {
6969 * @param {Boolean } highlight indicator if this post should be highlighted
7070 * @return {vnode } Returns a post
7171 */
72- const entry = ( model , post , index , highlight ) => h ( `.w-100.flex-row.shadow-level1${ highlight ? '.bg-success' : '' } ` , {
73- id : `post${ index } ` ,
74- style : {
75- margin : '5px' ,
76- } ,
77- } , [
78- h ( '.w-20.shadow-level' , { style : { padding : '10px' } } , [
79- h ( 'table' , [
80- h ( 'tbody' , Object . entries ( ACTIVE_FIELDS ) . map ( ( [ key , { name, format, visible } ] ) => visible && h ( 'tr' , [
81- h ( 'td' , { style : { 'text-align' : 'right' , 'font-weight' : 'bold' } } , `${ name } :` ) ,
82- h ( 'td' , post [ key ] ? format ? format ( post [ key ] ) : post [ key ] : 'None' ) ,
83- ] ) ) ) ,
72+ const entry = ( model , post , index , highlight ) =>
73+ h ( '.w-100.flex-row.shadow-level1' , {
74+ id : `post${ index } ` ,
75+ style : {
76+ margin : '5px' ,
77+ } ,
78+ } , [
79+ h ( `.w-20.shadow-level1${ highlight && '.bg-gray-light' } ` , {
80+ style : { padding : '10px' } ,
81+ } , [
82+ h ( 'table' , [
83+ h ( 'tbody' , Object . entries ( ACTIVE_FIELDS ) . map ( ( [ key , { name, format, visible } ] ) => visible && h ( 'tr' , [
84+ h ( 'td' , { style : { 'text-align' : 'right' , 'font-weight' : 'bold' } } , `${ name } :` ) ,
85+ h ( 'td' , post [ key ] && format ? format ( post [ key ] ) : post [ key ] || 'None' ) ,
86+ ] ) ) ) ,
87+ ] ) ,
88+ ] ) ,
89+ h ( '.w-80.shadow-level1' , { style : { padding : '10px' } } , [
90+ h ( 'h4' , post . title , replyButton ( model , post ) ) ,
91+ h ( `textarea.w-100#post-content${ index } ` , {
92+ oninit : ( ) => {
93+ const eventHandler = { location : '' , name : '' } ;
94+ const readOnlyProps = { isReadOnly : true , textValue : post . text } ;
95+ model . logs . clearSingleEditor ( ) ;
96+ model . logs . setMarkdownBox ( `post-content${ index } ` , eventHandler , readOnlyProps , true ) ;
97+ } ,
98+ } , post . text ) ,
8499 ] ) ,
85- ] ) ,
86- h ( '.w-80.shadow-level1' , { style : { padding : '10px' } } , [
87- h ( 'h4' , post . title , replyButton ( model , post ) ) ,
88- h ( '.w-100#post-content' , post . text ) ,
89- ] ) ,
90- ] ) ;
100+ ] ) ;
91101
92102export default entry ;
0 commit comments