mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: allow font customization
This commit is contained in:
1 parent
cf1195a6ee
commit
9b2c36efbf
13 files changed
+93
-31
No files matched your search
@@ -2,7 +2,7 @@ import { NamedPage } from 'vj/misc/Page';
|
||||
import i18n from 'vj/utils/i18n';
|
||||
import tpl from 'vj/utils/tpl';
|
||||
|
||||
const page = new NamedPage('home_preference', () => {
|
||||
function initCodeLangHelper() {
|
||||
function setOptions($el, options) {
|
||||
$el.empty();
|
||||
$.each(options, (key, value) => {
|
||||
@@ -66,6 +66,14 @@ const page = new NamedPage('home_preference', () => {
|
||||
$('#codelang-sub-select').on('change', function () {
|
||||
$('[name="codeLang"]').val(this.value);
|
||||
});
|
||||
}
|
||||
|
||||
const page = new NamedPage('home_preference', () => {
|
||||
initCodeLangHelper();
|
||||
$('[name="fontFamily"] option, [name="codeFontFamily"] option').each(function () {
|
||||
this.style.fontFamily = this.getAttribute('value');
|
||||
this.textContent = i18n(this.textContent.trim());
|
||||
});
|
||||
});
|
||||
|
||||
export default page;
|
||||
Reference in new issue
Block a user