Commit c5bcbc6d authored by Pierre Goubeaux's avatar Pierre Goubeaux
Browse files

filters complexeSelect

parent 2c8f5844
......@@ -10,7 +10,7 @@
.central-section .central-container #filterContainer{
margin-top: 0px;
}
#filterContainer .dropdown, #filters-nav .dropdown{
#filterContainer .dropdown , #filters-nav .dropdown{
/* height: 57px; */
margin-bottom: 5px;
margin-top: 5px;
......@@ -18,20 +18,64 @@
padding-top: 0px;
padding-bottom: 0px;
}
#filterContainer .dropdown .btn-menu, #filters-nav .dropdown .btn-menu, #filters-nav .filters-btn{
padding: 10px 15px;
font-size: 16px;
border: 1px solid #6b6b6b;
color: #6b6b6b;
top: 0px;
#filters-nav .dropdown-menu-complexe{
position: relative;
border-radius: 20px;
text-decoration: none;
background: white;
line-height: 20px;
background-color: white;
color: grey;
margin-top: 3%;
}
#filters-nav .dropdown .dropdown-menu {
position: absolute;
overflow-y: visible !important;
top: 50px;
left: 5px;
width: 250px;
border-radius: 2px;
border: 1px solid #38bbbc;
padding: 0px;
}
#filters-nav .dropdown-menu-complexe .list-filters .button-complexeSelectList{
background: transparent;
border: transparent;
}
#filters-nav .dropdown-menu-complexe .first-level{
font-size: 22px;
background: transparent;
border: transparent;
}
#filters-container .dropdown-menu-complexe , #filters-nav .dropdown-menu-complexe{
border-radius: 5px;
border: 1px solid #6b6b6b;
padding:10px;
}
#filters-nav .dropdown-menu-complexe .list-filters .button-complexeSelectList-subsub{
background: transparent;
border: transparent;
}
#filters-nav .dropdown-menu-complexe .list-filters .subsub{
display: grid;
font-size: 14px;
}
#filters-nav .dropdown-menu-complexe .list-filters .button-complexeSelectList-subsub:hover{
background-color : grey;
color: white;
}
#filters-nav .dropdown-menu-complexe .list-filters .button-complexeSelectList:hover{
background-color : grey;
color: white;
}
#filterContainer .dropdown .dropdown-menu, #filters-nav .dropdown .dropdown-menu{
position: absolute;
position: absolute;
overflow-y: visible !important;
top: 50px;
left: 5px;
......@@ -40,6 +84,7 @@
border: 1px solid #6b6b6b;
padding:0px;
}
#filterContainer .dropdown .dropdown-menu:before , #filters-nav .dropdown .dropdown-menu:before,
#filterContainer .dropdown .dropdown-menu:after, #filters-nav .dropdown .dropdown-menu:after,
#costum-scope-search .dropdown-result-global-search:before,
......@@ -54,20 +99,44 @@
border-width: 11px;
position: absolute;
}
#filterContainer .dropdown .dropdown-menu-complexe:before , #filters-nav .dropdown .dropdown-menu-complexe:before,
#filterContainer .dropdown .dropdown-menu-complexe:after, #filters-nav .dropdown .dropdown-menu-complexe:after{
bottom: 100%;
left: 20px;
margin-top: -20px;
border: solid transparent;
content: " ";
height: 0px;
width: 0;
border-width: 11px;
position: absolute;
}
#filterContainer .dropdown .dropdown-menu:before, #filters-nav .dropdown .dropdown-menu:before,
#costum-scope-search .dropdown-result-global-search:before{
border-bottom-color: grey;
border-width: 12px;
left: 19px;
}
#filterContainer .dropdown .dropdown-menu-complexe:before, #filters-nav .dropdown .dropdown-menu-complexe:before{
border-bottom-color: grey;
border-width: 12px;
left: 19px;
}
#filterContainer .dropdown .dropdown-menu:after, #filters-nav .dropdown .dropdown-menu:after,
#costum-scope-search .dropdown-result-global-search:after{
border-bottom-color: white;
}
#filterContainer .dropdown .dropdown-menu .list-filters, #filters-nav .dropdown .dropdown-menu .list-filters{
max-height: 300px;
overflow-y: scroll;
}
#filterContainer .dropdown .dropdown-menu button, #filters-nav .dropdown .dropdown-menu button{
border: none;
background: white;
......@@ -203,6 +272,7 @@
display: block;
text-align: left;
}
@media (max-width: 768px){
#filterContainer .dropdown, #filters-nav .dropdown,
#filterContainer #input-sec-search, #filters-nav #input-sec-search,
......
......@@ -42,7 +42,6 @@ var searchObj = {
mylog.log("fObj initDefaults defaults");
if(typeof pInit.defaults.fields != "undefined"){
$.each(pInit.defaults.fields,function(k,v){
mylog.log("fObj initDefaults fields",k, v);
if(typeof searchObject.filters == "undefined" )
searchObject.filters = {};
if(typeof searchObject.filters[k] == "undefined" )
......@@ -75,9 +74,14 @@ var searchObj = {
$.each(pInit.filters,function(k,v){
mylog.log("fObj initViews each", k,v);
if(typeof v.view != "undefined" && typeof fObj.views[v.view] != "undefined"){
str += fObj.views[v.view](k,v, fObj);
}else if(fObj.views[k] != "undefined")
if (typeof v.levelOptions != "undefined") {
str += fObj.views[v.view](k,v, v.levelOptions);
}else{
str += fObj.views[v.view](k,v, fObj);
}
}else if(fObj.views[k] != "undefined"){
str += fObj.views[k](k,v,fObj);
}
});
}
str+='<div id="activeFilters" class="col-xs-12"></div>';
......@@ -570,6 +574,61 @@ var searchObj = {
'</li>';
return str;
},
complexeSelect : function(k,v,level){
// k correspond categorySlections : { view : complexeSelect, event : filters, type : filters , list : hinauraCategory, levelFields : [category,...]}
mylog.log("fObj views complexeSelect",level);
level = (notNull(level)) ? level : 0;
label=(typeof v.name != "undefined") ? v.name: "Ajouter un filtre";
str='<div class="complexeSelect" id="complexeSelect">'+
'<a href="javascript:;" class="dropdown-toggle menu-button btn-menu" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-label-xs="types" data-toggle="tooltip" data-placement="bottom">'+
label+' <i class="fa fa-angle-down margin-left-5"></i>'+
'</a>'+'</div>'+
'<div id="dropdownComplexe" style="display:none;" class="dropdown-menu-complexe row" style="overflow-y: auto;margin-left-36px;" aria-labelledby="dropdownTypes">'+
'<div class="list-filters filterComplexe col-md-12">';
if(typeof v.list != "undefined"){
$.each( v.list ,function(kL,vL){
var i = 0;
icon = (typeof vL.icon != "undefined") ? "<i class='fa fa-"+vL.icon+"'> " : "";
if (typeof level[i].visible != "undefined" &&level[i].visible == true) {
str +='<div class=" '+kL+' col-md-3">';
str += '<button class="first-level lvl'+level[i]+'" data-field="'+level[i].field+'" data-type="'+v.type+'" data-key="'+kL+'" data-value="'+kL+'" >'+icon + vL.label+'</button><br>';
str += '<hr>';
i++;
}
if (typeof vL.subList != "undefined") {
if (typeof level[i].visible != "undefined" &&level[i].visible == true) {
$.each(vL.subList,function(kSub,vSub){
complexeList(i,level,kSub,vSub);
});
}
function complexeList(inc,lvl,keySub,valueSub){
mylog.log("complexeList filters",inc,lvl,keySub,valueSub);
str += '<div class="CategSubSub">';
if(typeof valueSub != "undefined" && typeof valueSub.subList != "undefined" &&typeof valueSub.label != "undefined"){
str += '<button class="button-complexeSelectList lvl'+inc+'">'+valueSub.label+' <i class="fa fa-angle-down margin-left-5"></i></button>';
inc++;
visible = (typeof lvl[inc].visible != "undefined" && lvl[inc].visible == true) ? lvl[inc].visible : "hidden";
str += '<hr class="'+visible+'">';
str += '<li class="'+visible+' subsub">';
$.each(valueSub.subList,function(key,value){
str += '<button class="lvl'+inc+' button-complexeSelectList-subsub" data-field="'+lvl[inc].field+'" data-type="'+v.type+'" data-key="'+value+'" data-value="'+value+'">'+value+'</button>';
});
str += '</li>';
}else{
str += '<button class="button-complexeSelectList lvl'+inc+'" data-field="'+lvl[inc].field+'" data-type="'+v.type+'" data-key="'+valueSub+'" data-value="'+valueSub+'">'+valueSub+'</button><br>';
}
str += '</div>';
}
}
str +='</div>';
});
}
str+='</div></div>';
return str;
},
scope : function(){
mylog.log("fObj views scope");
return '<div id="costum-scope-search"><div id="input-sec-search">'+
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment