Replace conditional with rescue's

Closes #1015, although this should really be taken care of by
finishing #1011.
This commit is contained in:
Eric Allen 2010-03-25 07:46:21 -04:00
parent d8c477eb54
commit 3c82b88720

View file

@ -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 -%>