From b2400e1255c275e01a6677dcf61f1d878f7526c7 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 30 May 2019 10:18:49 +0200 Subject: [PATCH] FIX: waits libs (highlightjs) to process post before acting --- common/header.html | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/common/header.html b/common/header.html index 8b52ab2..53b48bc 100644 --- a/common/header.html +++ b/common/header.html @@ -201,22 +201,24 @@ processChange($cooked, inputEvent, mappings); }, 250) ); + + Ember.run.later(() => { + // trigger fake event to setup initial state + Object.keys(placeholders).forEach(placeholderKey => { + const placeholder = placeholders[placeholderKey]; - // trigger fake event to setup initial state - Object.keys(placeholders).forEach(placeholderKey => { - const placeholder = placeholders[placeholderKey]; + const value = + placeholder.default || + (placeholder.defaults.length && !placeholder.description + ? placeholder.defaults[0] + : null); - const value = - placeholder.default || - (placeholder.defaults.length && !placeholder.description - ? placeholder.defaults[0] - : null); - - processChange( - $cooked, - { target: { value, dataset: { key: placeholderKey } } }, - mappings - ); - }); + processChange( + $cooked, + { target: { value, dataset: { key: placeholderKey } } }, + mappings + ); + }); + }, 500); });