mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-10 00:38:04 +08:00
35 lines
662 B
JavaScript
35 lines
662 B
JavaScript
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
var
|
|
$ = require('$'),
|
|
sUrl = null,
|
|
getUtl = function () {
|
|
if (!sUrl)
|
|
{
|
|
sUrl = 'rainloop/v/' + ($('#rlAppVersion').attr('content') || '0.0.0') + '/static/css/svg/icons.svg';
|
|
}
|
|
|
|
return sUrl;
|
|
}
|
|
;
|
|
|
|
module.exports = {
|
|
viewModel: {
|
|
createViewModel: function(oParams, oComponentInfo) {
|
|
var icon = oParams.icon || 'null';
|
|
if (oComponentInfo.element && oComponentInfo.element)
|
|
{
|
|
$(oComponentInfo.element).replaceWith(
|
|
'<svg class="svg-icon svg-icon-' + icon + '"><use xlink:href="' + getUtl() + '#svg-icon-' + icon + '"></use></svg>');
|
|
}
|
|
}
|
|
},
|
|
'template': '<b></b>'
|
|
};
|
|
|
|
}());
|
|
|
|
|