Commit 4434f93aa984aabbb5bc35225f0ffe92c0b6f05d

Authored by Dmitriy Zaporozhets
1 parent 8a179611

Select2 dropdown autoWidth

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/assets/javascripts/main.js.coffee
... ... @@ -68,7 +68,7 @@ $ -&gt;
68 68 e.preventDefault()
69 69  
70 70 # Initialize select2 selects
71   - $('select.select2').select2(width: 'resolve')
  71 + $('select.select2').select2(width: 'resolve', dropdownAutoWidth: true)
72 72  
73 73 # Initialize tooltips
74 74 $('.has_tooltip').tooltip()
... ...
app/assets/stylesheets/generic/selects.scss
... ... @@ -2,11 +2,20 @@
2 2  
3 3 .select2-container {
4 4 .select2-choice {
5   - background: #EEE;
  5 + background: #FFF;
6 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 19 select {
11 20 &.select2 {
12 21 width: 100px;
... ... @@ -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 75 .project-home-dropdown + & {
76 76 margin-right: 45px;
77 77 }
78   -
  78 +
79 79 .btn,
80 80 .form-control {
81 81 border: 1px solid #E1E1E1;
... ... @@ -234,39 +234,6 @@ ul.nav.nav-projects-tabs {
234 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 237 .deploy-project-label {
271 238 margin: 1px;
272 239 }
... ...