Use loader script to load beautify
This commit is contained in:
parent
92a49759a9
commit
b429735e86
|
@ -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');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user