mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Small improvements
This commit is contained in:
parent
5123841540
commit
c99a46a118
29 changed files with 459 additions and 26 deletions
35
dev/Component/SvgIcon.js
Normal file
35
dev/Component/SvgIcon.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
(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>'
|
||||
};
|
||||
|
||||
}());
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue