lineHeight.ts
1.29 KB
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
const lineHeight = function (tinymce: any) {
tinymce.PluginManager.add('lineheight', function (t: any) {
t.on('init', function () {
t.formatter.register({
lineheight: {
inline: 'span',
styles: {
'line-height': '%value',
},
},
});
});
t.ui.registry.addMenuButton('lineheight', {
icon: 'lineheight',
tooltip: 'Line Height',
// fetch: function (callback: Fn) {
// var dom = t.dom;
// var blocks = t.selection.getSelectedBlocks();
// var lhv = 0;
// global$1.each(blocks, function (block: any) {
// if (lhv == 0) {
// lhv = dom.getStyle(block, 'line-height') ? dom.getStyle(block, 'line-height') : 0;
// }
// });
// var items = lineheight_val.split(' ').map(function (item) {
// var text = item;
// var value = item;
// return {
// type: 'togglemenuitem',
// text: text,
// active: lhv == value ? true : false,
// onAction: function () {
// doAct(value);
// },
// };
// });
// callback(items);
// },
});
});
tinymce.PluginManager.requireLangPack('lineheight', 'de');
};
export default lineHeight;