mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Use proper HTMLTemplateElement for all knockoutjs templates
This commit is contained in:
parent
efc2dd89e1
commit
29367a0ea7
5 changed files with 2 additions and 40 deletions
|
|
@ -1,6 +0,0 @@
|
|||
import { componentExportHelper } from 'Component/Abstract';
|
||||
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
|
||||
|
||||
class ClassicCheckboxComponent extends AbstractCheckbox {}
|
||||
|
||||
export default componentExportHelper(ClassicCheckboxComponent, 'ClassicCheckboxComponent');
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
let cachedUrl = null;
|
||||
const getUrl = () => {
|
||||
if (!cachedUrl) {
|
||||
const version = jQuery('#rlAppVersion').attr('content') || '0.0.0';
|
||||
cachedUrl = `rainloop/v/${version}/static/css/svg/icons.svg`;
|
||||
}
|
||||
|
||||
return cachedUrl;
|
||||
};
|
||||
|
||||
export default {
|
||||
template: '<b></b>',
|
||||
viewModel: {
|
||||
createViewModel: ({ icon = 'null' }, componentInfo) => {
|
||||
if (componentInfo && componentInfo.element) {
|
||||
jQuery(componentInfo.element).replaceWith(
|
||||
`<svg class="svg-icon svg-icon-${icon}"><use xlink:href="${getUrl()}#svg-icon-${icon}"></use></svg>`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue