clarify smartblock OR vs AND

This commit is contained in:
r 2019-02-03 16:16:47 -06:00
parent eb2d463672
commit b532fe564e
5 changed files with 44 additions and 18 deletions

View file

@ -26,16 +26,16 @@
$nextDisabled = $this->element->getElement("sp_criteria_field_".$nextIndex)->getAttrib('disabled') == 'disabled'?true:false;
?>
<div <?php if (/*($i > 0) && */ $disabled) {
echo 'style=display:none';
} ?> >
echo 'style="display:none"';
}?> class="search-row-<?php echo $logicLabel ?>">
<?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?>
<?php echo $this->element->getElement("sp_criteria_modifier_".$i."_".$j) /* @todo finish this */?>
<?php echo $this->element->getElement("sp_criteria_value_".$i."_".$j) ?>
<span class='sp_text_font' id="datetime_select" <?php echo $this->element->getElement("sp_criteria_datetime_select_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo $this->element->getElement('sp_criteria_datetime_select_'.$i."_".$j) ?><?php echo _(" ago "); ?></span>
<a class='btn btn-small btn-new' id='modifier_add_<?php echo $i ?>'>
<i class='icon-white icon-plus'></i><?php echo(_("New Modifier")); ?>
<a <?php if ($disabled) { echo 'style=display:none'; } ?> class='modifier_add_link' id='modifier_add_<?php echo $i ?>'>
+ <?php echo(_("New Modifier")); ?>
</a>
<span class='sp_text_font' id="extra_criteria" <?php echo $this->element->getElement("sp_criteria_extra_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo _(" to "); ?><?php echo $this->element->getElement('sp_criteria_extra_'.$i."_".$j) ?></span>
@ -44,7 +44,7 @@
<a style='margin-right:3px' class='btn btn-small btn-danger' id='criteria_remove_<?php echo $i ?>'>
<i class='icon-white icon-remove spl-no-r-margin'></i>
</a>
<span class='db-logic-label' <?php if ($nextDisabled) echo "style='display:none'"?>>
<span class='db-logic-label<?php echo ' db-logic-label-' . $logicLabel; ?>' <?php if ($nextDisabled) echo 'style="display:none"';?>>
<?php echo $logicLabel;?>
</span>

View file

@ -216,7 +216,10 @@ tr.lib-selected > td > div.library_actions_btn:hover {
.search-criteria .criteria-element > div {
margin-bottom: 5px;
display: flex;
position: relative;
}
.search-criteria .criteria-element > div.search-row-and { margin-bottom: 36px; }
.search-criteria .criteria-element > div input[type="text"],
.search-criteria .criteria-element > div select {
-webkit-box-sizing: border-box;

View file

@ -533,6 +533,7 @@
#sp_criteria-element {
clear: both;
width: 100%;
}
/*

View file

@ -703,15 +703,29 @@ table.library-get-file-md.table-small{
/***** SMART BLOCK SPECIFIC STYLES BEGIN *****/
.modifier_add_link {
font-size: 12px;
display: block;
margin: 0 0 10px 33%;
text-decoration: underline;
cursor: pointer;
position: absolute;
top: 30px;
}
.db-logic-label {
font-size:11px;
font-size:14px;
position: absolute;
top: 36px;
}
.db-logic-label-and {
top: 42px;
}
.sp-invisible{
visibility: hidden;
}
.sp_input_select{
width: 140px;
flex: 0 0 33%;
}
.sp_input_text_limit{

View file

@ -25,9 +25,13 @@ function setSmartBlockEvents() {
} else {
div.find('.db-logic-label').text('and').show();
div.removeClass('search-row-or').addClass('search-row-and');
div = div.next().show();
div.children().removeAttr('disabled');
div.find(".modifier_add_link").show();
div = div.next();
if (div.length === 0) {
$(this).hide();
@ -36,7 +40,7 @@ function setSmartBlockEvents() {
appendAddButton();
appendModAddButton();
removeButtonCheck();
disableAndHideDateTimeDropdown(newRowVal);
// disableAndHideDateTimeDropdown(newRowVal);
}
});
@ -78,6 +82,10 @@ function setSmartBlockEvents() {
newRow.find('#criteria_add').remove();
$(this).parent().after(newRow);
newRow.prev().removeClass('search-row-and').addClass('search-row-or');
newRow.prev().find(".db-logic-label").removeClass('db-logic-label-and').addClass('db-logic-label-or');
reindexElements();
appendAddButton();
appendModAddButton();