Skip to content

Commit

Permalink
change to use _isHidden
Browse files Browse the repository at this point in the history
  • Loading branch information
moloko committed Mar 20, 2018
1 parent c49dbd3 commit 304af0c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The attributes listed below are used in *contentObjects.json* to configure **Box

**_classes** (string): CSS class name to be applied to menu item's `page` element (*src/core/js/views/pageView.js*). The class must be predefined in one of the Less files. Separate multiple classes with a space.

**_isHiddenFromMenu** (boolean): If you want to hide a content object from the menu, set this to `true`. This can be useful if, for example, you have a content object defined as a 'start page' for the course which you therefore don't want to be listed on the menu since the user will have already seen it.
**_isHidden** (boolean): If you want to hide a content object from the menu, set this to `true`. This can be useful if, for example, you have a content object defined as a 'start page' for the course which you therefore don't want to be listed on the menu since the user will have already seen it.

**title** (string): This text is a reference title for the content object.

Expand Down
20 changes: 10 additions & 10 deletions example.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_id":"co-05",
"_parentId":"course",
"_type":"page",
"_classes":"",
"_isHiddenFromMenu": false,
"title":"Welcome to Adapt Learning",
"displayTitle":"Welcome to Adapt Learning",
"body":"This page contains a working Adapt page with all core bundled components and plugins working.",
"_id": "co-05",
"_parentId": "course",
"_type": "page",
"_classes": "",
"_isHidden": false,
"title": "Welcome to Adapt Learning",
"displayTitle": "Welcome to Adapt Learning",
"body": "This page contains a working Adapt page with all core bundled components and plugins working.",
"_graphic": {
"alt": "Welcome to Adapt Learning",
"src": "course/en/images/origami-menu-one.jpg"
},
"linkText":"View",
"duration":"2 mins"
"linkText": "View",
"duration": "2 mins"
}
4 changes: 2 additions & 2 deletions js/adapt-contrib-boxmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ define([
postRender: function() {
var nthChild = 0;
this.model.getChildren().each(function(item) {
if (item.get('_isAvailable') && !item.get('_isHiddenFromMenu')) {
if (item.get('_isAvailable') && !item.get('_isHidden')) {
item.set('_nthChild', ++nthChild);
this.$('.menu-container-inner').append(new BoxMenuItemView({model: item}).$el);
}

if(item.get('_isHiddenFromMenu')) {
if(item.get('_isHidden')) {
item.set('_isReady', true);
}
});
Expand Down

0 comments on commit 304af0c

Please sign in to comment.