mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
show currently running timer in window title, menu item
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
<%= javascript_tag do %>
|
||||
Stopwatch.currentTimerUrl = '<%= j current_stopwatch_timers_url %>';
|
||||
window.stopwatch = window.initStopwatch({
|
||||
currentTimerUrl: '<%= j current_stopwatch_timers_url %>',
|
||||
hourFormat: '<%= j format_hours 0.0 %>'
|
||||
});
|
||||
<% if User.current.logged? %>
|
||||
window.stopwatch.highlightRunningTimer(
|
||||
<%= raw Stopwatch::Timer.new(User.current).to_json %>
|
||||
)
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -5,5 +5,11 @@
|
||||
$('#ajax-modal').html('<%= j render partial: 'new' %>');
|
||||
showModal('ajax-modal', '700px');
|
||||
<% end %>
|
||||
Stopwatch.highlightTimer('<%= @started_time_entry.id if @started_time_entry %>');
|
||||
|
||||
<% if @started_time_entry %>
|
||||
window.stopwatch.timerStarted('<%= @started_time_entry.id %>',
|
||||
'<%= j format_hours @started_time_entry.hours %>');
|
||||
<% else %>
|
||||
window.stopwatch.timerStopped();
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user