Skip to content

Commit 7099064

Browse files
committed
cleanup changes
use hypthens in names of css classes / ids, remove comment fragments
1 parent f7b43f6 commit 7099064

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

app/assets/javascripts/modules/work_item_autocomplete.js.coffee

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class app.WorkItemAutocomplete extends app.Autocomplete
2020
# renderes a progress bar depending on how much of the budget is already used
2121
offered_hours = item.attr('data-offered_hours')
2222
done_hours = parseFloat(item.attr('data-done_hours')).toFixed(2)
23-
$('#live_bar_success').removeClass( "bg-green bg-orange bg-red" ).addClass("bg-" + @picked_color(offered_hours, done_hours));
23+
$('#live-bar-success').removeClass( "bg-green bg-orange bg-red" ).addClass("bg-" + @picked_color(offered_hours, done_hours));
2424

2525
# handle the case where the budget is not set (offered_hours == 'null')
2626
# CAREFUL: if not set in the db, due to the json serializer, offered_hours will be 'null' (string).
@@ -33,25 +33,24 @@ class app.WorkItemAutocomplete extends app.Autocomplete
3333
percentage = 0
3434

3535
# set tooltip
36-
$('.live_budget_bar').attr('data-original-title', "#{ done_hours } h / #{ offered_hours } h (#{ percentage }%)");
36+
$('.live-budget-bar').attr('data-original-title', "#{ done_hours } h / #{ offered_hours } h (#{ percentage }%)");
3737
# show progress bar
38-
$('.live_budget_bar').css("visibility", "visible");
38+
$('.live-budget-bar').css("visibility", "visible");
3939
# set length of filled part of progress bar
40-
$('#live_bar_success').width(Math.min(percentage,100) + '%');
40+
$('#live-bar-success').width(Math.min(percentage,100) + '%');
4141

4242
onItemAdd: (value, item) =>
4343
billable = item.attr('data-billable') == 'true'
4444
meal_compensation = item.attr('data-meal_compensation') == 'true'
4545
$('#ordertime_billable').prop('checked', billable);
4646
$('#ordertime_meal_compensation').prop('checked', meal_compensation);
47-
# sets
4847
@set_progress_bar(item)
4948

5049

5150
onItemRemove: (value, item) ->
5251
# Removes the progress bar if no position is selected
53-
$('#live_bar_success').width(0 + '%');
54-
$('.live_budget_bar').css("visibility", "hidden");
52+
$('#live-bar-success').width(0 + '%');
53+
$('.live-budget-bar').css("visibility", "hidden");
5554

5655
renderOption: (item, escape) ->
5756
"<div class='selectize-option'>" +
@@ -68,5 +67,5 @@ class app.WorkItemAutocomplete extends app.Autocomplete
6867
$(document).on('turbolinks:load', ->
6968
$('[data-autocomplete=work_item]').each((i, element) -> new app.WorkItemAutocomplete().bind(element))
7069
# hide the progress bar depicting the usage of the budget upon initialization of the site
71-
$('.live_budget_bar').css("visibility", "hidden");
70+
$('.live-budget-bar').css("visibility", "hidden");
7271
)

app/assets/stylesheets/components/_progress.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
display: block;
33
}
44

5-
.live_budget_bar {
5+
.live-budget-bar {
66
.progress {
77
height: 7px;
88
margin-bottom: 0;
9-
// background-color: white;
10-
// box-shadow:none;
119
}
1210
}
1311

app/views/ordertimes/_form.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
required: true,
2727
data: { autocomplete: 'work_item',
2828
url: search_work_items_path })
29-
%span{ title: "", data: { toggle: "tooltip", original_title: "Budgetnutzung" }, class: "live_budget_bar"}
29+
%span{ title: "", data: { toggle: "tooltip", original_title: "Budgetnutzung" }, class: "live-budget-bar"}
3030
%a.progress
31-
%div#live_bar_success.progress-bar
31+
%div#live-bar-success.progress-bar
3232
3333
= f.labeled_input_field(:ticket, span: 2)
3434
= f.labeled_text_area(:description)

0 commit comments

Comments
 (0)