@@ -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)
0 commit comments