From 85cbdbb6b718a488af39a4b1a9a3a4ffd2a54985 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Wed, 4 Nov 2015 10:59:19 +0800 Subject: [PATCH] * adjust the code. --- module/bug/css/browse.css | 13 ++++--------- module/bug/js/browse.js | 22 ++++------------------ module/bug/view/browse.html.php | 8 ++++---- 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/module/bug/css/browse.css b/module/bug/css/browse.css index 99c40aca21..8a01602e3b 100644 --- a/module/bug/css/browse.css +++ b/module/bug/css/browse.css @@ -5,12 +5,7 @@ .confirm1 {color:green; font-size:9px} .red{color:red;} -.assign-menu {min-width: 150px; overflow: hidden; max-height: 305px} -.assign-menu.with-search {padding-bottom: 34px;} -.assign-menu > .assign-search {padding: 0; position: absolute; z-index: 0; bottom: 0; left: 0; right: 0} -.assign-menu > .assign-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666} - -.fix-menu {min-width: 150px; overflow: hidden} -.fix-menu.with-search {padding-bottom: 35px;} -.fix-menu > .fix-search {padding: 0; position: absolute; z-index: 0; bottom: 0; left: 0; right: 0} -.fix-menu > .fix-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666} +.dropdown-menu.with-search {padding-bottom: 34px; min-width: 150px; overflow: hidden; max-height: 305px} +.dropdown-menu > .menu-search {padding: 0; position: absolute; z-index: 0; bottom: 0; left: 0; right: 0} +.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} diff --git a/module/bug/js/browse.js b/module/bug/js/browse.js index a4feb3c15f..807e065633 100644 --- a/module/bug/js/browse.js +++ b/module/bug/js/browse.js @@ -4,30 +4,16 @@ $(document).ready(function() $('#module' + moduleID).addClass('active'); if(browseType == 'bysearch') ajaxGetSearchForm(); - $('.assign-search').click(function(e) + $('.dropdown-menu .with-search .menu-search').click(function(e) { e.stopPropagation(); return false; }).on('keyup change paste', 'input', function() { var val = $(this).val().toLowerCase(); - if(val == '') return $('.assign-menu > .option').removeClass('hide'); - $('.assign-menu > .option').each(function() - { - var $option = $(this); - $option.toggleClass('hide', $option.text().toString().toLowerCase().indexOf(val) < 0 && $option.data('key').toString().toLowerCase().indexOf(val) < 0); - }); - }); - - $('.fix-search').click(function(e) - { - e.stopPropagation(); - return false; - }).on('keyup change paste', 'input', function() - { - var val = $(this).val().toLowerCase(); - if(val == '') return $('.fix-menu > .option').removeClass('hide'); - $('.fix-menu > .option').each(function() + var $options = $(this).parents('ul.dropdown-menu.with-search').find('.option'); + if(val == '') return $options.removeClass('hide'); + $options.each(function() { var $option = $(this); $option.toggleClass('hide', $option.text().toString().toLowerCase().indexOf(val) < 0 && $option.data('key').toString().toLowerCase().indexOf(val) < 0); diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 05a782fbea..879984383d 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -207,7 +207,7 @@ js::set('moduleID', $moduleID); $withSearch = count($builds) > 4; echo "