diff --git a/cms/static/js/menu.js b/cms/static/js/menu.js index 4586689..6304365 100644 --- a/cms/static/js/menu.js +++ b/cms/static/js/menu.js @@ -324,10 +324,25 @@ menu.tabs = { } // return [_button,_label] // } menu.tabs.init =function (_layout){ + // + // Let us determine what kind of menu is suited for this + // @TODO: Make menus configurable i.e on other areas of the site + // + var _count = 0 + var _items = 0 + Object.keys(_layout.menu).forEach(_name=>{ + _items += _layout.menu[_name].length + _count += 1 + }) + if (_count == _items){ + var _menuObject = new QCMSTabs (_layout) + }else{ + var _menuObject = new QCMSBasic (_layout) + } // console.log(_layout) // var _tabs = new QCMSTabs (_layout) - var _tabs = new QCMSBasic (_layout) - _tabs.init() + + _menuObject.init() } diff --git a/cms/templates/menu.html b/cms/templates/menu.html index 72f8e58..b47f6b3 100644 --- a/cms/templates/menu.html +++ b/cms/templates/menu.html @@ -11,33 +11,37 @@ {% endif %} -{% for _name in layout.menu %} + -
- {% endif %} - - {{_item.text.replace('-',' ').replace('_',' ')}} +