diff --git a/assets/js/components/menuBar/authenticated.js b/assets/js/components/menuBar/authenticated.js index 54ca6bc6..1fd9c937 100644 --- a/assets/js/components/menuBar/authenticated.js +++ b/assets/js/components/menuBar/authenticated.js @@ -90,7 +90,7 @@ ComunicWeb.components.menuBar.authenticated = { navbarCollapseElemList.className = "nav navbar-nav"; //Add search form - this.addSearchForm(navbarCollapseElemList); + //this.addSearchForm(navbarCollapseElemList); //Navbar right elements var navbarRight = createElem("div", navBar); diff --git a/assets/js/components/sidebar/main.js b/assets/js/components/sidebar/main.js index 171766fc..0e697bd3 100644 --- a/assets/js/components/sidebar/main.js +++ b/assets/js/components/sidebar/main.js @@ -67,5 +67,40 @@ ComunicWeb.components.sideBar.main = { ] }); }); + + + + // Search form + var searchForm = createElem2({ + appendTo: section, + type: "form", + class: "sidebar-form", + children: [ + createElem2({ + type: "div", + class: "input-group", + children: [ + createElem2({ + type: "input", + class: "form-control", + elemType: "text", + placeholder: "Search...", + }), + + createElem2({ + type: "span", + class: "input-group-btn", + innerHTML: '', + }), + ] + }) + ] + }); + + searchForm.addEventListener("submit", function(e){ + e.preventDefault(); + + openPage("search?q=" + searchForm.getElementsByTagName("input")[0].value); + }); } } \ No newline at end of file