Commit bb166e4b71b75f8a16d90b52f6bd578a410addbb

Authored by Braulio Bhavamitra
1 parent 25e3ce14

Add method to return theme javascript source

Showing 1 changed file with 7 additions and 6 deletions   Show diff stats
app/helpers/application_helper.rb
@@ -674,13 +674,14 @@ module ApplicationHelper @@ -674,13 +674,14 @@ module ApplicationHelper
674 html.join "\n" 674 html.join "\n"
675 end 675 end
676 676
  677 + def theme_javascript_src
  678 + script = File.join theme_path, 'theme.js'
  679 + script if File.exists? File.join(Rails.root, 'public', script)
  680 + end
  681 +
677 def theme_javascript_ng 682 def theme_javascript_ng
678 - script = File.join(theme_path, 'theme.js')  
679 - if File.exists?(File.join(Rails.root, 'public', script))  
680 - javascript_include_tag script  
681 - else  
682 - nil  
683 - end 683 + script = theme_javascript_src
  684 + javascript_include_tag script if script
684 end 685 end
685 686
686 def file_field_or_thumbnail(label, image, i) 687 def file_field_or_thumbnail(label, image, i)