Skip to content

Commit

Permalink
Merge b94120a into 4846476
Browse files Browse the repository at this point in the history
  • Loading branch information
hoand-vn committed Aug 1, 2018
2 parents 4846476 + b94120a commit cd04f53
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion src/Eccube/Resource/template/admin/Content/block.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,62 @@ file that was distributed with this source code.
</style>
{% endblock %}

{% block javascript %}
<script>
var searchWord = function () {
var searchText = $(this).val(), // 検索ボックスに入力された値
targetText;
// 検索ボックスに値が入っていない場合
if (searchText == '') {
// 全て表示する
$('.list-group li').show();
return;
}
// 検索ボックスに値が入ってる場合
// 表示を全て空にする
$('.list-group li').hide();
// 検索ワードが(子を含めて)含まれる要素のみ表示
$('.list-group li').each(function () {
targetText = $(this).find('> div.row > div > a').text();
// 検索対象となるリストに入力された文字列が存在するかどうかを判断
if (targetText.indexOf(searchText) != -1) {
// 存在する場合はそのリストのテキストを用意した配列に格納
$(this).show();
}
});
};
// searchWordの実行
$('#search-block').on('input', searchWord);
</script>
{% endblock javascript %}

{% block main %}
<div class="c-contentsArea__cols">
<div class="c-contentsArea__primaryCol">
<div class="c-primaryCol">
<div class="row justify-content-between mb-2">
<div class="col-9"></div>
<div class="col-3">
<div class="form-row">
<div class="col">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="fa fa-search"></i></span>
</div>
<input id="search-block" class="form-control" type="search" aria-label="Search">
</div>
</div>
</div>
</div>
</div>
<div class="card rounded border-0 mb-4">
<div class="card-body p-0">
<div class="card rounded border-0 mb-2">
<div class="card rounded border-0">
<ul class="list-group list-group-flush">
{% for Block in Blocks %}
<li id="ex-block-{{ Block.id }}" class="list-group-item">
Expand Down

0 comments on commit cd04f53

Please sign in to comment.