mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
Replace conditional with rescue's
Closes #1015, although this should really be taken care of by finishing #1011.
This commit is contained in:
parent
d8c477eb54
commit
3c82b88720
1 changed files with 5 additions and 7 deletions
|
|
@ -13,16 +13,14 @@
|
|||
<%= javascript_tag "var SOURCE_VIEW = '#{@source_view}';" %>
|
||||
<%= javascript_tag "var TAG_NAME = '#{@tag_name}';" if @tag_name %>
|
||||
<script type="text/javascript">
|
||||
<% if defined? context_names_for_autocomplete -%>
|
||||
var contextNames = <%= context_names_for_autocomplete %>;
|
||||
var projectNames = <%= project_names_for_autocomplete %>;
|
||||
var defaultContexts = <%= default_contexts_for_autocomplete %>;
|
||||
var defaultTags = <%= default_tags_for_autocomplete %>;
|
||||
var tagNames = <%= tag_names_for_autocomplete %>;
|
||||
var contextNames = <%= context_names_for_autocomplete rescue '[]' %>;
|
||||
var projectNames = <%= project_names_for_autocomplete rescue '[]' %>;
|
||||
var defaultContexts = <%= default_contexts_for_autocomplete rescue '{}' %>;
|
||||
var defaultTags = <%= default_tags_for_autocomplete rescue '{}' %>;
|
||||
var tagNames = <%= tag_names_for_autocomplete rescue '[]' %>;
|
||||
var dateFormat = '<%= date_format_for_date_picker %>';
|
||||
var weekStart = '<%= current_user.prefs.week_starts %>';
|
||||
function relative_to_root(path) { return '<%= root_url %>'+path; };
|
||||
<% end -%>
|
||||
<% if @prefs.refresh != 0 -%>
|
||||
setup_auto_refresh(<%= @prefs["refresh"].to_i*60000 %>);
|
||||
<% end -%>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue