Skip to content
This repository has been archived by the owner on Jun 26, 2018. It is now read-only.

Remove hardcoded paths in Javascript. #197

Closed
nstriedinger opened this issue Nov 17, 2016 · 1 comment
Closed

Remove hardcoded paths in Javascript. #197

nstriedinger opened this issue Nov 17, 2016 · 1 comment
Assignees

Comments

@nstriedinger
Copy link
Contributor

nstriedinger commented Nov 17, 2016

Please remove hardcoded paths. Add a JS global "directory" setting variable for paths. In this instance, use it for '/assets/'.

For example:
richText.js - fetch('/assets/images/svg-sprite/external-link.svg'

$.ajax({ url : '/assets/js/templates/' + name + '.html',

This should be in a separate file, maybe called 'settings.js' and not aggregated in.

Something like this

  • create a new file called env.js
  • add var themePath = '/assets';
  • update code like so: fetch(themePath + "/images/svg-sprite/external-link.svg"
  • include separately from index-generated.js and vendor-generated.js
@legostud
Copy link
Contributor

Looks like you fixed this already. Sorry I wasn't able to get to it before my long weekend.

@legostud legostud assigned nstriedinger and unassigned legostud Nov 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants