FilterWidget: if "is set" is chosen in the operation dropdown, then the operation value field and the option field will be hidden

This commit is contained in:
Paolo
2018-02-13 13:52:45 +01:00
parent 41f32a7d5e
commit c2b328c69f
2 changed files with 14 additions and 2 deletions
@@ -4,6 +4,10 @@
margin: 0 10px 10px 10px;
}
.hidden-control {
display: none !important;
}
</style>
<script language="Javascript" type="text/javascript">
$(document).ready(function() {
+10 -2
View File
@@ -323,6 +323,14 @@ class FilterWidget extends Widget
}
elseif ($filterMetaData->type == 'timestamp')
{
$classOperation = 'select-filter-operation-value';
$classOption = 'select-filter-option';
if ($activeFilterOperationValue == self::OP_SET)
{
$classOperation .= ' hidden-control';
$classOption .= ' hidden-control';
}
$html = '
<span>
<select name="%s" class="select-filter-operation">
@@ -333,9 +341,9 @@ class FilterWidget extends Widget
</select>
</span>
<span>
<input type="text" name="%s" value="%s" class="select-filter-operation-value">
<input type="text" name="%s" value="%s" class="'.$classOperation.'">
</span>
<select name="%s" class="select-filter-option">
<select name="%s" class="'.$classOption.'">
<option value="'.self::OPT_DAYS.'" '.($activeFilterOptionValue == self::OPT_DAYS ? 'selected' : '').'>Days</option>
<option value="'.self::OPT_MONTHS.'" '.($activeFilterOptionValue == self::OPT_MONTHS ? 'selected' : '').'>Months</option>
</select>