Minor code clean
This commit is contained in:
parent
8ee28b214d
commit
ed552f1591
|
|
@ -1,13 +0,0 @@
|
|||
/*
|
||||
* Filter Behavior
|
||||
*
|
||||
* Data attributes:
|
||||
* - data-behavior="filter" - enables the filter plugin
|
||||
*
|
||||
* JavaScript API:
|
||||
* $('a#someLink').filterBehavior()
|
||||
*
|
||||
* Dependences:
|
||||
* - October Popover (october.popover.js)
|
||||
*/
|
||||
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
// <tr>
|
||||
// <th class="list-checkbox">
|
||||
// <div class="checkbox custom-checkbox nolabel">
|
||||
// <input type="checkbox" id="checkbox_0" />
|
||||
// <label for="checkbox_0"></label>
|
||||
// <input type="checkbox" id="checkboxAll" />
|
||||
// <label for="checkboxAll"></label>
|
||||
// </div>
|
||||
// </th>
|
||||
// <th class="sort-desc"><a href="/">Title</a></th>
|
||||
|
|
@ -26,7 +26,8 @@
|
|||
// <tr>
|
||||
// <td class="list-checkbox nolink">
|
||||
// <div class="checkbox custom-checkbox nolabel">
|
||||
// <input id="checkbox_1" type="checkbox" /><label for="checkbox_1"></label>
|
||||
// <input id="checkbox_1" type="checkbox" />
|
||||
// <label for="checkbox_1">Check</label>
|
||||
// </div>
|
||||
// </td>
|
||||
// <td><a href="/">Welcome to October</a></td>
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class TemplateList extends WidgetBase
|
|||
'descriptions' => $descriptions
|
||||
];
|
||||
|
||||
return (object)$result;
|
||||
return (object) $result;
|
||||
}
|
||||
|
||||
protected function getItemTitle($item)
|
||||
|
|
@ -270,16 +270,19 @@ class TemplateList extends WidgetBase
|
|||
if (strlen($item->title)) {
|
||||
if (Str::contains(Str::lower($item->title), $word))
|
||||
return true;
|
||||
} else
|
||||
if (Str::contains(Str::lower($item->fileName), $word))
|
||||
}
|
||||
else if (Str::contains(Str::lower($item->fileName), $word)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Str::contains(Str::lower($item->description), $word) && strlen($item->description))
|
||||
if (Str::contains(Str::lower($item->description), $word) && strlen($item->description)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($item->descriptions as $value)
|
||||
foreach ($item->descriptions as $value) {
|
||||
if (Str::contains(Str::lower($value), $word) && strlen($value))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,15 @@
|
|||
<?= $this->makePartial('items', ['items'=>$item->items, 'nested'=>true]) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php else:
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$dataId = $this->itemType.'-'.$this->theme->getDirName().'-'.$item->fileName;
|
||||
?>
|
||||
<li class="item" data-item-path="<?= e($item->fileName) ?>" data-item-theme="<?= e($this->theme->getDirName()) ?>" data-item-type="<?= $this->itemType ?>" data-id="<?= e($dataId) ?>">
|
||||
<a href="#">
|
||||
<span class="title"><?= e($item->title) ?></span>
|
||||
<span class="description">
|
||||
<?php foreach ($item->descriptions as $title=>$value): ?>
|
||||
<?php foreach ($item->descriptions as $title => $value): ?>
|
||||
<?php if (strlen($value)): ?>
|
||||
<?= e($title) ?>: <strong><?= e($value) ?></strong>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue