Skip to content

Commit

Permalink
$mol_list renders Empty when no rows taked.
Browse files Browse the repository at this point in the history
  • Loading branch information
nin--jin committed Mar 1, 2017
1 parent e7ef6e1 commit bbd91f5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions list/demo/demo.view.css
@@ -0,0 +1,4 @@
[mol_list_demo_empty_empty] {
padding: 1rem;
display: block;
}
8 changes: 7 additions & 1 deletion list/demo/demo.view.tree
@@ -1,4 +1,10 @@
$mol_list_demo $mol_scroll
$mol_list_demo_large $mol_scroll
sub /
<= lister $mol_list
rows <= rows /

$mol_list_demo_empty $mol_list
rows /
Empty $mol_view
sub /
<= empty_message @ \Empty list
2 changes: 1 addition & 1 deletion list/demo/demo.view.ts
@@ -1,5 +1,5 @@
namespace $.$mol {
export class $mol_list_demo extends $.$mol_list_demo {
export class $mol_list_demo_large extends $.$mol_list_demo_large {

rows() {
var next : $mol_view[] = []
Expand Down
1 change: 1 addition & 0 deletions list/list.view.tree
Expand Up @@ -2,3 +2,4 @@ $mol_list $mol_view
style *
minHeight <= minimal_height -
sub <= rows /
Empty null
5 changes: 5 additions & 0 deletions list/list.view.ts
@@ -1,6 +1,11 @@
namespace $.$mol {
export class $mol_list extends $.$mol_list {

sub() {
const rows = this.rows()
return ( rows.length === 0 ) ? [ this.Empty() ] : rows
}

@ $mol_mem()
row_offsets() : number[] {
var sub = this.sub()
Expand Down

0 comments on commit bbd91f5

Please sign in to comment.