Minor code clean

This commit is contained in:
Sam Georges 2014-10-18 15:52:44 +11:00
parent 8ee28b214d
commit ed552f1591
5 changed files with 25 additions and 33 deletions

View File

@ -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)
*/

View File

@ -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>

View File

@ -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;
}

View File

@ -8,7 +8,8 @@
<?= $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) ?>">