@silexlabs/silex 3.0.0-alpha.150 → 3.0.0-alpha.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silexlabs/silex",
3
3
  "description": "Free and easy website builder for everyone.",
4
- "version": "3.0.0-alpha.150",
4
+ "version": "3.0.0-alpha.151",
5
5
  "version:backwardcompat": "3.0.0",
6
6
  "author": {
7
7
  "name": "Alex Hoyau",
@@ -78,9 +78,7 @@ export const settingsDialog = (editor, opts) => {
78
78
  const model = editor.getModel()
79
79
  model.set('settings', data.settings || {})
80
80
  model.set('name', data.name)
81
- })
82
- // On chrome this is needed to apply the head content to the DOM
83
- editor.on('storage:end:load', () => {
81
+ // On chrome this is needed to apply the head content to the DOM
84
82
  setTimeout(() => {
85
83
  updateDom(editor)
86
84
  })
@@ -228,13 +226,15 @@ function getHeadContainer(doc, className) {
228
226
  }
229
227
  function updateDom(editor) {
230
228
  const doc = editor.Canvas.getDocument()
231
- if(doc) {
229
+ const settings = editor.getModel().get('settings')
230
+ const pageSettings = editor.Pages.getSelected().get('settings')
231
+ if(doc && settings) {
232
232
  // Site head
233
233
  getHeadContainer(doc, 'site-head')
234
- .innerHTML = editor.getModel().get('settings').head || ''
234
+ .innerHTML = settings.head || ''
235
235
  // Pages head
236
236
  getHeadContainer(doc, 'page-head')
237
- .innerHTML = editor.Pages.getSelected().get('settings')?.head || ''
237
+ .innerHTML = pageSettings?.head || ''
238
238
  } else {
239
239
  // No document??
240
240
  }