Commit 4434f93aa984aabbb5bc35225f0ffe92c0b6f05d
1 parent
8a179611
Exists in
spb-stable
and in
3 other branches
Select2 dropdown autoWidth
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
18 additions
and
36 deletions
Show diff stats
app/assets/javascripts/main.js.coffee
| @@ -68,7 +68,7 @@ $ -> | @@ -68,7 +68,7 @@ $ -> | ||
| 68 | e.preventDefault() | 68 | e.preventDefault() |
| 69 | 69 | ||
| 70 | # Initialize select2 selects | 70 | # Initialize select2 selects |
| 71 | - $('select.select2').select2(width: 'resolve') | 71 | + $('select.select2').select2(width: 'resolve', dropdownAutoWidth: true) |
| 72 | 72 | ||
| 73 | # Initialize tooltips | 73 | # Initialize tooltips |
| 74 | $('.has_tooltip').tooltip() | 74 | $('.has_tooltip').tooltip() |
app/assets/stylesheets/generic/selects.scss
| @@ -2,11 +2,20 @@ | @@ -2,11 +2,20 @@ | ||
| 2 | 2 | ||
| 3 | .select2-container { | 3 | .select2-container { |
| 4 | .select2-choice { | 4 | .select2-choice { |
| 5 | - background: #EEE; | 5 | + background: #FFF; |
| 6 | border-color: #BBB; | 6 | border-color: #BBB; |
| 7 | + | ||
| 8 | + .select2-arrow { | ||
| 9 | + background: #FFF; | ||
| 10 | + } | ||
| 7 | } | 11 | } |
| 8 | } | 12 | } |
| 9 | 13 | ||
| 14 | +.select2-drop-active { | ||
| 15 | + border: 1px solid #BBB; | ||
| 16 | + margin-top: 4px; | ||
| 17 | +} | ||
| 18 | + | ||
| 10 | select { | 19 | select { |
| 11 | &.select2 { | 20 | &.select2 { |
| 12 | width: 100px; | 21 | width: 100px; |
| @@ -51,3 +60,9 @@ select { | @@ -51,3 +60,9 @@ select { | ||
| 51 | } | 60 | } |
| 52 | } | 61 | } |
| 53 | } | 62 | } |
| 63 | + | ||
| 64 | + | ||
| 65 | +/** Branch/tag selector **/ | ||
| 66 | +.project-refs-form .select2-container { | ||
| 67 | + margin-right: 10px; | ||
| 68 | +} |
app/assets/stylesheets/sections/projects.scss
| @@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
| 75 | .project-home-dropdown + & { | 75 | .project-home-dropdown + & { |
| 76 | margin-right: 45px; | 76 | margin-right: 45px; |
| 77 | } | 77 | } |
| 78 | - | 78 | + |
| 79 | .btn, | 79 | .btn, |
| 80 | .form-control { | 80 | .form-control { |
| 81 | border: 1px solid #E1E1E1; | 81 | border: 1px solid #E1E1E1; |
| @@ -234,39 +234,6 @@ ul.nav.nav-projects-tabs { | @@ -234,39 +234,6 @@ ul.nav.nav-projects-tabs { | ||
| 234 | min-width: 200px; | 234 | min-width: 200px; |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | -/** Branch/tag selector **/ | ||
| 238 | -.project-refs-form { | ||
| 239 | - margin: 0; | ||
| 240 | - span { | ||
| 241 | - background:none !important; | ||
| 242 | - position:static !important; | ||
| 243 | - width:auto !important; | ||
| 244 | - height:auto !important; | ||
| 245 | - } | ||
| 246 | -} | ||
| 247 | - | ||
| 248 | -.project-refs-form .select2-container { | ||
| 249 | - position: relative; | ||
| 250 | - top: 0; | ||
| 251 | - left: 0; | ||
| 252 | - margin-right: 10px; | ||
| 253 | - | ||
| 254 | - .select2-single span { | ||
| 255 | - font-weight: bold; | ||
| 256 | - color: #555; | ||
| 257 | - } | ||
| 258 | - | ||
| 259 | - &.select2-container-active { | ||
| 260 | - .select2-drop { | ||
| 261 | - min-width: 400px; | ||
| 262 | - } | ||
| 263 | - | ||
| 264 | - .select2-results { | ||
| 265 | - max-height: 400px; | ||
| 266 | - } | ||
| 267 | - } | ||
| 268 | -} | ||
| 269 | - | ||
| 270 | .deploy-project-label { | 237 | .deploy-project-label { |
| 271 | margin: 1px; | 238 | margin: 1px; |
| 272 | } | 239 | } |