Make it easier to customize JavaScript functions
When there was a custom JavaScript file, we weren't loading the original one, meaning that, in order to customize it, it was necessary to copy the whole original file and then changing it. Now we're loading both the original and the custom file, so the custom file can simply add more functions or overwrite the ones we'd like to customize, without copying the whole file. Existing copies of original files will still overwrite the whole file and won't be affected.
This commit is contained in:
@@ -114,6 +114,7 @@
|
||||
//= require_tree ./admin
|
||||
//= require_tree ./sdg
|
||||
//= require_tree ./sdg_management
|
||||
//= require_tree ./custom
|
||||
|
||||
var initialize_modules = function() {
|
||||
"use strict";
|
||||
|
||||
@@ -114,7 +114,7 @@ end
|
||||
class Rails::Engine
|
||||
initializer :prepend_custom_assets_path, group: :all do |app|
|
||||
if self.class.name == "Consul::Application"
|
||||
%w[images fonts javascripts].each do |asset|
|
||||
%w[images fonts].each do |asset|
|
||||
app.config.assets.paths.unshift(Rails.root.join("app", "assets", asset, "custom").to_s)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user