From fab9e186c960b4d7717bb3637233d29055edce9d Mon Sep 17 00:00:00 2001 From: Ahmed Zamil Date: Fri, 23 Apr 2021 12:11:07 +0300 Subject: [PATCH] navbar --- css/iui.css | 2 +- src/UI/Navbar.js | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/css/iui.css b/css/iui.css index 4185647..682fbe9 100644 --- a/css/iui.css +++ b/css/iui.css @@ -2616,13 +2616,13 @@ html[dir='rtl'] .multiselect-list-remove { position: relative; overflow: hidden; } - .link { position: relative; overflow: hidden; display: block; + cursor: pointer; } .button:after, .ripple:after, .link:after{ diff --git a/src/UI/Navbar.js b/src/UI/Navbar.js index 89dda2a..cfb3d3e 100644 --- a/src/UI/Navbar.js +++ b/src/UI/Navbar.js @@ -126,7 +126,7 @@ export default IUI.module(class Navbar extends IUIElement get auto(){ return this.hasAttribute("auto"); } - + build(){ this.innerHTML = ""; @@ -155,20 +155,22 @@ export default IUI.module(class Navbar extends IUIElement return false; if (this.private instanceof Function) - { - try{ - if (this.private(r)) - { - return false; - } - } catch(ex){ - console.log(ex); - debugger; - } + { + try{ + if (this.private(r)) + { + return false; + } + } catch(ex){ + console.log(ex); + debugger; + } - return true; - } - }); + return true; + } + + return true; + }); const appendRoutes = (routes, level, container) => { for (var i = 0; i < routes.length; i++) { @@ -193,7 +195,7 @@ export default IUI.module(class Navbar extends IUIElement item.appendChild(link); container.appendChild(item); - this._list.push(item); + self._list.push(item); let subRoutes = filterRoutes(routes[i].routes); @@ -236,7 +238,7 @@ export default IUI.module(class Navbar extends IUIElement created() { if (!this.hasAttribute("manual")) - window.router.on("created", this.build); + window.router.on("created", ()=>this.build()); window.router.on("navigate", (e) => {