Skip to content

Commit 2beddfc

Browse files
committed
Portal.view.learn.PageSectionsContainer: disable the sections expand button, in case there is no content #5685
1 parent ea6b731 commit 2beddfc

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

apps/portal/view/learn/MainContainerModel.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class MainContainerModel extends Component {
2929
* @member {Number|null} data.countPages=null
3030
*/
3131
countPages: null,
32+
/**
33+
* @member {Number|null} data.countPages=null
34+
*/
35+
countSections: null,
3236
/**
3337
* The record which gets shown as the content page
3438
* @member {Object} data.currentRecord=null

apps/portal/view/learn/PageSectionsContainer.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ class PageSectionsContainer extends Container {
2121
*/
2222
items: [{
2323
ntype : 'button',
24-
bind : {hidden: data => data.size === 'large'},
2524
cls : ['sections-container-button'],
2625
handler: 'onPageSectionsToggleButtonClick',
2726
iconCls: 'fas fa-bars',
28-
ui : 'secondary'
27+
ui : 'secondary',
28+
29+
bind: {
30+
disabled: data => data.countSections < 1,
31+
hidden : data => data.size === 'large'
32+
}
2933
}, {
3034
vdom:
3135
{cn: [

apps/portal/view/learn/PageSectionsList.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ class PageSectionsList extends List {
7575
me.isAnimating = false
7676
}
7777
}
78+
79+
/**
80+
*
81+
*/
82+
onStoreLoad() {
83+
super.onStoreLoad();
84+
85+
this.getModel().data.countSections = this.store.getCount()
86+
}
7887
}
7988

8089
Neo.setupClass(PageSectionsList);

resources/scss/src/apps/portal/learn/PageSectionsContainer.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
left : -42px;
4747
width : 35px;
4848

49+
&.neo-disabled {
50+
background-color: lightgray;
51+
opacity : .5;
52+
}
53+
4954
.neo-button-glyph {
5055
font-size: 13px;
5156
}

0 commit comments

Comments
 (0)