Use loader script to load beautify

This commit is contained in:
Rob Garrison 2017-08-20 13:10:16 -05:00
parent 92a49759a9
commit b429735e86

View File

@ -1,6 +1,6 @@
/* eslint brace-style: 0, operator-linebreak: 0 */ /* eslint brace-style: 0, operator-linebreak: 0 */
/* global CodeMirror parserlib */ /* global CodeMirror parserlib */
/* global exports css_beautify */ /* global exports css_beautify onDOMscripted */
/* global CSSLint initLint getLinterConfigForCodeMirror updateLintReport renderLintReport updateLinter */ /* global CSSLint initLint getLinterConfigForCodeMirror updateLintReport renderLintReport updateLinter */
'use strict'; 'use strict';
@ -1058,9 +1058,9 @@ function getEditorInSight(nearbyElement) {
} }
function beautify(event) { function beautify(event) {
const script = document.head.appendChild(document.createElement('script')); const script = $('script[src*="beautify-css-mod"]') ?
script.src = 'vendor-overwrites/beautify/beautify-css-mod.js'; [] : ['vendor-overwrites/beautify/beautify-css-mod.js'];
script.onload = doBeautify; onDOMscripted(script).then(doBeautify);
function doBeautify() { function doBeautify() {
const tabs = prefs.get('editor.indentWithTabs'); const tabs = prefs.get('editor.indentWithTabs');