diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2020-02-11 19:53:18 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 20:53:18 -0500 |
commit | d67e9b9629557df1e355f0a864792c194b3e8848 (patch) | |
tree | f7138acd6776fe08ebb40b840d898fbb47234d4a /web_src/js/utils.js | |
parent | 2399bad1f1a4ab36b2fd05745beaea5fb1f53dab (diff) | |
download | gitea-d67e9b9629557df1e355f0a864792c194b3e8848.tar.gz gitea-d67e9b9629557df1e355f0a864792c194b3e8848.zip |
SVG Octicon fixes (#10237)
* SVG fixes
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Colorize span->svg only
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* @silverwind suggestions
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Alphabetical
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Convert suburl and staticPrefix to window.config
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* De-structure
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'web_src/js/utils.js')
-rw-r--r-- | web_src/js/utils.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web_src/js/utils.js b/web_src/js/utils.js new file mode 100644 index 0000000000..2effddd685 --- /dev/null +++ b/web_src/js/utils.js @@ -0,0 +1,5 @@ +const { StaticUrlPrefix } = window.config; + +export function svg(name, size) { + return `<svg class="svg ${name}" width="${size}" height="${size}" aria-hidden="true"><use xlink:href="${StaticUrlPrefix}/img/svg/icons.svg#${name}"/></svg>`; +} |