mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
adds project_id arg to 'log time' link to preselect the current project, if any.
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
window.stopwatch.highlightRunningTimer(
|
window.stopwatch.highlightRunningTimer(
|
||||||
<%= raw Stopwatch::Timer.new(User.current).to_json %>
|
<%= raw Stopwatch::Timer.new(User.current).to_json %>
|
||||||
)
|
);
|
||||||
|
window.stopwatch.setProjectId('<%= j @project&.id.to_s %>');
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ window.initStopwatch = function(config){
|
|||||||
time_entry_id: entryId,
|
time_entry_id: entryId,
|
||||||
time_spent: spentTime
|
time_spent: spentTime
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
setProjectId: function(projectId){
|
||||||
|
var a = $('a#stopwatch-menu');
|
||||||
|
a.attr('href', a.attr('href').replace(/\/new.*$/, '/new?project_id='+projectId));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user