Fix: don't use leading underscore for function name

This commit is contained in:
eight 2017-09-12 19:37:06 +08:00
parent e4d3025fca
commit 27f8bc2f85

View File

@ -1002,12 +1002,13 @@ function jumpToLine(cm) {
function toggleStyle() { function toggleStyle() {
if (!editor) { if (!editor) {
return _toggleStyle(); toggleSectionStyle();
return;
} }
editor.toggleStyle(); editor.toggleStyle();
} }
function _toggleStyle() { function toggleSectionStyle() {
$('#enabled').checked = !$('#enabled').checked; $('#enabled').checked = !$('#enabled').checked;
save(); save();
} }
@ -1365,7 +1366,8 @@ function setStyleMeta(style) {
function initWithStyle({style}) { function initWithStyle({style}) {
// FIXME: what does codeIsUpdated do? // FIXME: what does codeIsUpdated do?
if (!style.usercss) { if (!style.usercss) {
return _initWithStyle({style}); initWithSectionStyle({style});
return;
} }
if (editor) { if (editor) {
@ -1375,7 +1377,7 @@ function initWithStyle({style}) {
} }
} }
function _initWithStyle({style, codeIsUpdated}) { function initWithSectionStyle({style, codeIsUpdated}) {
setStyleMeta(style); setStyleMeta(style);
if (codeIsUpdated === false) { if (codeIsUpdated === false) {
@ -1572,12 +1574,13 @@ function updateLintReportIfEnabled(...args) {
function save() { function save() {
if (!editor) { if (!editor) {
return _save(); saveSectionStyle();
return;
} }
editor.save(); editor.save();
} }
function _save() { function saveSectionStyle() {
updateLintReportIfEnabled(null, 0); updateLintReportIfEnabled(null, 0);
// save the contents of the CodeMirror editors back into the textareas // save the contents of the CodeMirror editors back into the textareas