fix in filters if send empty index array it reset this menu
+ fix in filters if click reset it really reset to init + made buttons be inputs
This commit is contained in:
@@ -5,23 +5,31 @@ function mp_filter_drop_down($key, &$filter) {
|
||||
// // version div stick
|
||||
// // version div switch
|
||||
// // version div visibility
|
||||
//
|
||||
// form="ljdp_form"
|
||||
|
||||
$content = '
|
||||
<div class="filter_menu filter_menu_drop" style="display:none;" tabindex=0>
|
||||
<div class="filter_menu_title filter_menu_drop_title" tabindex=0>
|
||||
<select
|
||||
form="ljdp_form"
|
||||
class="filter_menu filter_menu_drop"
|
||||
>
|
||||
<option
|
||||
selected
|
||||
onclick="filter_show_only_selection(this, '.json_encode(array()).', '."'".$key."'".')"
|
||||
>
|
||||
<p>'.$key.'</p>
|
||||
</div>
|
||||
<div class="filter_menu_drop_items" tabindex=0>
|
||||
</option>
|
||||
';
|
||||
foreach ($filter as $value) {
|
||||
$content .= '
|
||||
<p onclick="filter_show_only_selection(this, '.json_encode($value->indexes).', '."'".$key."'".')">'.$value->_name.'</p>
|
||||
<option
|
||||
onclick="filter_show_only_selection(this, '.json_encode($value->indexes).', '."'".$key."'".')"
|
||||
>
|
||||
<p>'.$value->_name.'</p>
|
||||
</option>
|
||||
';
|
||||
}
|
||||
$content .= '
|
||||
</div>
|
||||
</div>
|
||||
</select>
|
||||
';
|
||||
|
||||
return $content;
|
||||
@@ -34,8 +42,17 @@ function mp_filter_buttons($key, &$filter) {
|
||||
$content = '';
|
||||
foreach ($filter as $value) {
|
||||
$content .= '
|
||||
<input id="checkbox_'.$value->_name.'" class="filter_menu_checkbox" type="checkbox" style="display:none;" onclick="filter_show_only_selection(this, '.json_encode($value->indexes).', '."'".$key."'".', true)">
|
||||
<label for="checkbox_'.$value->_name.'" class="filter_menu_checkbox filter_menu">
|
||||
<input
|
||||
type="checkbox"
|
||||
form="ljdp_form"
|
||||
id="checkbox_'.$value->_name.'"
|
||||
class="filter_menu_checkbox"
|
||||
onclick="filter_show_only_selection(this, '.json_encode($value->indexes).', '."'".$key."'".', true)"
|
||||
>
|
||||
<label
|
||||
for="checkbox_'.$value->_name.'"
|
||||
class="filter_menu_checkbox filter_menu"
|
||||
>
|
||||
<div class="filter_menu_title filter_menu_checkbox_title" tabindex=0>
|
||||
<p>'.$value->_name.'</p>
|
||||
</div>
|
||||
@@ -49,6 +66,7 @@ function mp_filter_buttons($key, &$filter) {
|
||||
function mp_create_div(&$filters) {
|
||||
$mp_map_div = '
|
||||
<div id="ljdp_map_wrapper">
|
||||
<form id="ljdp_form" style="display:none;"></form>
|
||||
<div id="ljdp_map_filters">
|
||||
';
|
||||
|
||||
@@ -61,11 +79,22 @@ function mp_create_div(&$filters) {
|
||||
};
|
||||
|
||||
$mp_map_div .= '
|
||||
<div class="filter_menu filter_menu_button">
|
||||
<input
|
||||
type="reset"
|
||||
form="ljdp_form"
|
||||
id="filter_menu_reset"
|
||||
class="filter_menu_button"
|
||||
onclick="filter_show_all()"
|
||||
style="display:none;"
|
||||
>
|
||||
<label
|
||||
for="filter_menu_reset"
|
||||
class="filter_menu_button filter_menu"
|
||||
>
|
||||
<div class="filter_menu_title filter_menu_button_title">
|
||||
<p onclick="filter_show_all()">sans filtre</p>
|
||||
<p>Éffacer</p>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
';
|
||||
|
||||
$mp_map_div .= '
|
||||
|
||||
Reference in New Issue
Block a user