]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | // IE8 has an odd bug with handling font icons in pseudo elements;\r |
2 | // it will render the icon once and not update it when something\r | |
3 | // like text color is changed via style addition or removal.\r | |
4 | // We have to force icon repaint by adding a style with forced empty\r | |
5 | // pseudo element content, (x-sync-repaint) and removing it back to work\r | |
6 | // around this issue.\r | |
7 | // See this: https://github.com/FortAwesome/Font-Awesome/issues/954\r | |
8 | // and this: https://github.com/twbs/bootstrap/issues/13863\r | |
9 | Ext.define('Admin.override.menu.Item', {\r | |
10 | override: 'Ext.menu.Item',\r | |
11 | \r | |
12 | compatibility: 'IE@8', // only activate this override on IE8\r | |
13 | \r | |
14 | onFocus: function(e) {\r | |
15 | this.callParent([e]);\r | |
16 | this.repaintFontIcons();\r | |
17 | },\r | |
18 | \r | |
19 | onFocusLeave: function(e) {\r | |
20 | this.callParent([e]);\r | |
21 | this.repaintFontIcons();\r | |
22 | },\r | |
23 | \r | |
24 | privates: {\r | |
25 | repaintFontIcons: function() {\r | |
26 | var itemEl = this.itemEl,\r | |
27 | textEl = this.textEl,\r | |
28 | fly;\r | |
29 | \r | |
30 | // This application uses font icons on some elements that the framework\r | |
31 | // does not expect, so we have to extend its normal IE8 workarounds\r | |
32 | \r | |
33 | if (itemEl && this.el.hasCls('font-icon')) {\r | |
34 | itemEl.syncRepaint();\r | |
35 | }\r | |
36 | \r | |
37 | if (textEl) {\r | |
38 | fly = Ext.fly(textEl.dom.firstChild);\r | |
39 | \r | |
40 | if (fly && fly.hasCls(Ext.baseCSSPrefix + 'fa')) {\r | |
41 | fly.syncRepaint();\r | |
42 | }\r | |
43 | }\r | |
44 | }\r | |
45 | }\r | |
46 | });\r |