FIX: waits libs (highlightjs) to process post before acting

This commit is contained in:
Joffrey JAFFEUX 2019-05-30 10:18:49 +02:00 committed by GitHub
parent 41408e51fa
commit b2400e1255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 15 deletions

View File

@ -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);
});
</script>