Made eslint using 'browser' environment and added globals, because RainLoop is used in browsers.

This also allowed to remove all webpack 'externals' overhead.
This commit is contained in:
djmaze 2020-08-12 00:25:36 +02:00
parent c3a213802d
commit e7180a86ce
81 changed files with 1857 additions and 1259 deletions

View file

@ -1,9 +1,7 @@
import $ from '$';
let cachedUrl = null;
const getUrl = () => {
if (!cachedUrl) {
const version = $('#rlAppVersion').attr('content') || '0.0.0';
const version = jQuery('#rlAppVersion').attr('content') || '0.0.0';
cachedUrl = `rainloop/v/${version}/static/css/svg/icons.svg`;
}
@ -15,7 +13,7 @@ export default {
viewModel: {
createViewModel: ({ icon = 'null' }, componentInfo) => {
if (componentInfo && componentInfo.element) {
$(componentInfo.element).replaceWith(
jQuery(componentInfo.element).replaceWith(
`<svg class="svg-icon svg-icon-${icon}"><use xlink:href="${getUrl()}#svg-icon-${icon}"></use></svg>`
);
}