diff options
author | 2018-02-21 12:46:50 +0100 | |
---|---|---|
committer | 2018-02-21 12:46:50 +0100 | |
commit | fd36235fe44dd9c57669e1f529b9bb56774ece6b (patch) | |
tree | 6813016b3611d25570aa7f076b3ed1d84ccfefe6 /src | |
parent | fix CSS conflicts (diff) | |
download | ferdium-app-fd36235fe44dd9c57669e1f529b9bb56774ece6b.tar.gz ferdium-app-fd36235fe44dd9c57669e1f529b9bb56774ece6b.tar.zst ferdium-app-fd36235fe44dd9c57669e1f529b9bb56774ece6b.zip |
fix observable template
Diffstat (limited to 'src')
-rw-r--r-- | src/components/layout/AppLayout.js | 1 | ||||
-rw-r--r-- | src/lib/Menu.js | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 20fe61092..6162840be 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -6,7 +6,6 @@ import { TitleBar } from 'electron-react-titlebar'; | |||
6 | 6 | ||
7 | import InfoBar from '../ui/InfoBar'; | 7 | import InfoBar from '../ui/InfoBar'; |
8 | import globalMessages from '../../i18n/globalMessages'; | 8 | import globalMessages from '../../i18n/globalMessages'; |
9 | import Menu from '../../lib/Menu'; | ||
10 | 9 | ||
11 | function createMarkup(HTMLString) { | 10 | function createMarkup(HTMLString) { |
12 | return { __html: HTMLString }; | 11 | return { __html: HTMLString }; |
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 75f2efbea..3b02273ed 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -116,6 +116,7 @@ const template = [ | |||
116 | 116 | ||
117 | export default class FranzMenu { | 117 | export default class FranzMenu { |
118 | @observable tpl = template; | 118 | @observable tpl = template; |
119 | @observable template = null; | ||
119 | 120 | ||
120 | constructor(stores, actions) { | 121 | constructor(stores, actions) { |
121 | this.stores = stores; | 122 | this.stores = stores; |
@@ -124,12 +125,12 @@ export default class FranzMenu { | |||
124 | autorun(this._build.bind(this)); | 125 | autorun(this._build.bind(this)); |
125 | } | 126 | } |
126 | 127 | ||
127 | @computed get template() { | 128 | get template() { |
128 | return toJS(this.tpl); | 129 | return this.template; |
129 | } | 130 | } |
130 | 131 | ||
131 | _build() { | 132 | _build() { |
132 | const tpl = this.template; | 133 | const tpl = toJS(this.tpl); |
133 | 134 | ||
134 | tpl[1].submenu.push({ | 135 | tpl[1].submenu.push({ |
135 | role: 'toggledevtools', | 136 | role: 'toggledevtools', |
@@ -252,6 +253,7 @@ export default class FranzMenu { | |||
252 | tpl[isMac ? 3 : 2].submenu = toJS(this.serviceTpl); | 253 | tpl[isMac ? 3 : 2].submenu = toJS(this.serviceTpl); |
253 | } | 254 | } |
254 | 255 | ||
256 | this.template = tpl; | ||
255 | const menu = Menu.buildFromTemplate(tpl); | 257 | const menu = Menu.buildFromTemplate(tpl); |
256 | Menu.setApplicationMenu(menu); | 258 | Menu.setApplicationMenu(menu); |
257 | } | 259 | } |