Integration of the chosen jquery plugin for the board selector

This commit is contained in:
Frédéric Guillot 2014-07-06 11:28:01 -03:00
parent 7b96013a06
commit 0e118da124
7 changed files with 17 additions and 3 deletions

View File

@ -201,7 +201,7 @@ class Board extends Base
'categories' => $this->category->getList($project_id, true, true),
'menu' => 'boards',
'title' => $projects[$project_id],
'board_selector' => array(t('Display another project')) + $projects,
'board_selector' => $projects,
)));
}

View File

@ -9,10 +9,12 @@
<?= Helper\js('assets/js/jquery-1.11.1.min.js') ?>
<?= Helper\js('assets/js/jquery-ui-1.10.4.custom.min.js') ?>
<?= Helper\js('assets/js/jquery.ui.touch-punch.min.js') ?>
<?= Helper\js('assets/js/chosen.jquery.min.js') ?>
<?= Helper\css('assets/css/app.css') ?>
<?= Helper\css('assets/css/font-awesome.min.css') ?>
<?= Helper\css('assets/css/jquery-ui-1.10.4.custom.css'); ?>
<?= Helper\css('assets/css/chosen.min.css'); ?>
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<link rel="apple-touch-icon" href="assets/img/touch-icon-iphone.png">
@ -36,7 +38,12 @@
<ul>
<?php if (isset($board_selector)): ?>
<li>
<?= Helper\form_select('board-selector', $board_selector) ?>
<select id="board-selector" data-placeholder="<?= t('Display another project') ?>">
<option value=""></option>
<?php foreach($board_selector as $board_id => $board_name): ?>
<option value="<?= $board_id ?>"><?= Helper\escape($board_name) ?></option>
<?php endforeach ?>
</select>
</li>
<?php endif ?>
<li <?= isset($menu) && $menu === 'boards' ? 'class="active"' : '' ?>>

3
assets/css/chosen.min.css vendored Executable file

File diff suppressed because one or more lines are too long

BIN
assets/img/chosen-sprite.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

BIN
assets/img/chosen-sprite@2x.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

View File

@ -193,7 +193,9 @@
board_load_events();
filter_load_events();
$("#form-board-selector").change(function() {
$("#board-selector").chosen();
$("#board-selector").change(function() {
window.location = "?controller=board&action=show&project_id=" + $(this).val();
});
});

2
assets/js/chosen.jquery.min.js vendored Executable file

File diff suppressed because one or more lines are too long