From 4e502e57eba3830199ea4099798a4b3040f76c24 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 20 Aug 2017 19:25:27 -0500 Subject: [PATCH] Fix import into editor --- edit/edit.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index e1eb8f7c..1f3d72a1 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -1504,8 +1504,14 @@ function fromMozillaFormat() { }, 100); }); - function doImport() { - const replaceOldStyle = this.name === 'import-replace'; + function doImport(event) { + // parserlib contained in CSSLint-worker.js + onDOMscripted(['vendor-overwrites/csslint/csslint-worker.js']) + .then(() => doImportWhenReady(event.target)); + } + + function doImportWhenReady(target) { + const replaceOldStyle = target.name === 'import-replace'; $('.dismiss', popup).onclick(); const mozStyle = trimNewLines(popup.codebox.getValue()); const parser = new parserlib.css.Parser();