| 60 | |
| 61 | @Listen('ionStyle') |
| 62 | childrenStyle(ev: CustomEvent<StyleEventDetail>) { |
| 63 | ev.stopPropagation(); |
| 64 | |
| 65 | const tagName = (ev.target as HTMLElement).tagName; |
| 66 | const updatedStyles = ev.detail; |
| 67 | const newStyles = {} as CssClassMap; |
| 68 | const childStyles = this.childrenStyles.get(tagName) || {}; |
| 69 | |
| 70 | let hasStyleChange = false; |
| 71 | Object.keys(updatedStyles).forEach((key) => { |
| 72 | const childKey = `toolbar-${key}`; |
| 73 | const newValue = updatedStyles[key]; |
| 74 | if (newValue !== childStyles[childKey]) { |
| 75 | hasStyleChange = true; |
| 76 | } |
| 77 | if (newValue) { |
| 78 | newStyles[childKey] = true; |
| 79 | } |
| 80 | }); |
| 81 | |
| 82 | if (hasStyleChange) { |
| 83 | this.childrenStyles.set(tagName, newStyles); |
| 84 | forceUpdate(this); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | render() { |
| 89 | const mode = getIonMode(this); |