This commit is contained in:
滔哥
2017-12-11 11:43:47 +08:00
parent 56274294f3
commit 71e60a0d5e
2 changed files with 14 additions and 2 deletions
+8
View File
@@ -0,0 +1,8 @@
.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
.dropdown-menu > .menu-search .input-group {width:100%;}
.dropdown-menu > .menu-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666}
.dropdown-menu > .menu-search .form-control {border: none!important; box-shadow: none!important; border-top: 1px solid #ddd!important;}
.dropdown-list {display: block; padding: 0; max-height: 270px; overflow-y: auto;}
.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
.dropdown-list > li > a:hover,
.dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;}
+6 -2
View File
@@ -24,18 +24,22 @@
echo '<li id="all">' . html::a(inlink('dynamic', "projectID=$projectID&type=all"), $lang->action->dynamic->all) . '</li>';
// echo "<li id='account'>" . html::select('account', $users, $account, "onchange=changeUser(this.value,$projectID)") . '</li>';
$withSearch = count($users) > 10;
echo "<li id='account' class='dropdown'>";
$current = zget($users, isset($account) ? $account : '', '');
if(empty($current)) $current = $lang->project->byUser;
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown'");
echo "<ul class='dropdown-menu'>";
echo "<div class='dropdown-menu" . ($withSearch ? ' with-search':'') . "'>";
echo '<ul class="dropdown-list">';
foreach ($users as $key => $value)
{
echo '<li' . ($key == $account ? " class='active'" : '') . '>';
if($key == '') echo html::a($this->createLink('project', 'dynamic', "projectID=$projectID&type=all"), $lang->project->all);
else echo html::a($this->createLink('project', 'dynamic', "projectID=$projectID&type=account&param=$key"), $value);
echo '</li>';
}
echo '</ul></li>';
echo "</ul>";
echo "</div></li>";
?>
</ul>
</div>