Small improvements

This commit is contained in:
RainLoop Team 2015-07-29 22:13:49 +04:00
parent 5123841540
commit c99a46a118
29 changed files with 459 additions and 26 deletions

35
dev/Component/SvgIcon.js Normal file
View 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>'
};
}());