-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathkendo.icons.js
76 lines (61 loc) · 2.21 KB
/
kendo.icons.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import './kendo.html.icon.js';
import * as svgIcons from '@progress/kendo-svg-icons';
export const __meta__ = {
id: "icons",
name: "Icons",
category: "web",
description: "The Icons set provides both FontIcon and SvgIcon components along with the SVG icons collection from @progress/kendo-svg-icons",
depends: ["core", "html.icon"]
};
(function($, undefined) {
var kendo = window.kendo,
html = kendo.html,
ui = kendo.ui,
Widget = ui.Widget,
extend = $.extend;
var FontIcon = Widget.extend({
init: function(element, options) {
var that = this;
Widget.fn.init.call(that, element, options);
delete options.name;
that._icon = new html.HTMLFontIcon(element, $.extend({}, options));
that.element = that.wrapper = that._icon.element;
kendo.notify(that);
},
options: extend({}, html.HTMLFontIcon.fn.options, {
name: 'FontIcon'
}),
setOptions: function(options) {
var that = this;
Widget.fn.setOptions.call(that, options);
that._icon = new html.HTMLFontIcon(that.element, $.extend({}, that.options));
}
});
var SvgIcon = Widget.extend({
init: function(element, options) {
var that = this;
Widget.fn.init.call(that, element, options);
delete options.name;
that._icon = new html.HTMLSvgIcon(element, $.extend({}, options));
that.element = that.wrapper = that._icon.element;
kendo.notify(that);
},
options: extend({}, html.HTMLSvgIcon.fn.options, {
name: 'SvgIcon'
}),
setOptions: function(options) {
var that = this;
Widget.fn.setOptions.call(that, options);
if (options.icon) {
this.element.html('');
}
that._icon = new html.HTMLSvgIcon(that.element, $.extend({}, that.options));
}
});
kendo.ui.plugin(FontIcon);
kendo.ui.plugin(SvgIcon);
kendo.setDefaults('iconType', 'svg');
kendo.ui.svgIcons = svgIcons;
kendo.ui.icon = html.renderIcon;
})(window.kendo.jQuery);
export default kendo;