From 787b8b16005eb9d598e1a5a5c58e2b8c5ebdf86b Mon Sep 17 00:00:00 2001 From: zmagod Date: Tue, 6 Dec 2016 12:01:02 +0100 Subject: [PATCH] fixed new sample type/group form --- .../javascripts/samples/sample_types_groups.js | 5 ++++- app/assets/stylesheets/my_modules.scss | 2 +- app/assets/stylesheets/sample_types_groups.scss | 8 ++++++-- app/views/sample_groups/index.html.erb | 16 +++++++++++++--- app/views/sample_types/index.html.erb | 4 +++- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/samples/sample_types_groups.js b/app/assets/javascripts/samples/sample_types_groups.js index 66961969b..386a31c59 100644 --- a/app/assets/javascripts/samples/sample_types_groups.js +++ b/app/assets/javascripts/samples/sample_types_groups.js @@ -43,6 +43,8 @@ destroySampleTypeGroup(); initSampleGroupColor(); appendCarretToColorPickerDropdown(); + editSampleGroupColor(); + editSampleGroupForm(); } }); @@ -106,7 +108,7 @@ function editSampleGroupColor() { $(document).ready(function() { - $('.color-btn').on('click', function() { + $('.edit_sample_group a.color-btn').on('click', function() { var color = $(this).attr('data-value'); var form = $(this).closest('form'); $('select[name="sample_group[color]"]') @@ -126,6 +128,7 @@ appendCarretToColorPickerDropdown(); editSampleGroupColor(); editSampleGroupForm(); + destroySampleTypeGroup(); }).bind('ajax:error', function(ev, error) { $(this).clearFormErrors(); var msg = $.parseJSON(error.responseText); diff --git a/app/assets/stylesheets/my_modules.scss b/app/assets/stylesheets/my_modules.scss index 7fcd48408..920042383 100644 --- a/app/assets/stylesheets/my_modules.scss +++ b/app/assets/stylesheets/my_modules.scss @@ -9,7 +9,7 @@ } .btn-colorselector{ - background-color: transparent; + background-color: transparent; } .step-container .row { diff --git a/app/assets/stylesheets/sample_types_groups.scss b/app/assets/stylesheets/sample_types_groups.scss index 155cdf9cf..fe7d003f2 100644 --- a/app/assets/stylesheets/sample_types_groups.scss +++ b/app/assets/stylesheets/sample_types_groups.scss @@ -21,6 +21,7 @@ #remove { margin-left: 5px; + margin-top: 10px; } } @@ -47,10 +48,9 @@ .sample-group-colorselector { border-radius: 0; display: inline-block; - width: 20px; height: 20px; vertical-align: middle; - + width: 20px; } .color-picker { @@ -94,3 +94,7 @@ } } } + +#new_sample_group .color-picker { + margin-top: 7px; +} diff --git a/app/views/sample_groups/index.html.erb b/app/views/sample_groups/index.html.erb index fa191f2dd..ac506be02 100644 --- a/app/views/sample_groups/index.html.erb +++ b/app/views/sample_groups/index.html.erb @@ -21,15 +21,25 @@