chore: update luna setting

This commit is contained in:
redhoodsu
2023-02-02 19:51:24 +08:00
parent 6e0a2a4471
commit 7cb5bea838
5 changed files with 15 additions and 4 deletions

View File

@@ -40,6 +40,7 @@ module.exports = {
resolve: {
alias: {
axios: path.resolve(__dirname, '../src/lib/empty.js'),
micromark: path.resolve(__dirname, '../src/lib/micromark.js'),
},
},
devServer: {

View File

@@ -69,7 +69,7 @@
"luna-modal": "^1.0.0",
"luna-notification": "^0.1.4",
"luna-object-viewer": "^0.2.4",
"luna-setting": "^0.3.0",
"luna-setting": "^0.4.1",
"luna-tab": "^0.1.2",
"luna-text-viewer": "^0.2.1",
"node-sass": "^7.0.1",

View File

@@ -28,14 +28,17 @@ export default class Settings extends Tool {
}
remove(config, key) {
if (isStr(config)) {
const self = this
this._$el.find('.luna-setting-item-title').each(function () {
const $this = $(this)
if ($this.text() === config) $this.remove()
if ($this.text() === config) {
self._setting.remove(this.settingItem)
}
})
} else {
this._settings = filter(this._settings, (setting) => {
if (setting.config === config && setting.key === key) {
setting.item.detach()
this._setting.remove(setting.item)
return false
}

3
src/lib/micromark.js Normal file
View File

@@ -0,0 +1,3 @@
export function micromark(str) {
return str
}

View File

@@ -363,9 +363,13 @@
}
.luna-setting-item {
&:hover {
&:hover,
&.luna-setting-selected {
background: var(--darker-background);
}
&.luna-setting-selected:focus {
outline: none;
}
}
.luna-setting-item-title {