Merge pull request #39 from htmltiger/htmltiger-patch-1

subdir depth config added
This commit is contained in:
htmltiger 2022-03-12 01:22:22 +00:00 committed by GitHub
commit 65c4ac9ead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -70,5 +70,6 @@ choose the first blank in dropdown menu and type some text and hit Save or ctrl+
| hidefooter | `false` |
| basic | `false` | Force basic editor
| size | `100` | font size
| depth | `2` | subfolder depth 0 or more
Please backup your files before using as there is no undo.

View file

@ -1,4 +1,4 @@
console.info("Config Editor 4.0");
console.info("Config Editor 4.1");
const LitElement = window.LitElement || Object.getPrototypeOf(customElements.get("hui-masonry-view") );
const html = LitElement.prototype.html;
const css = LitElement.prototype.css;
@ -179,7 +179,7 @@ localSet(k,v){
cmd(action, data, file){
return this._hass.callWS({type: "config_editor/ws", action: action,
data: data, file: file, ext: this.edit.ext});
data: data, file: file, ext: this.edit.ext, depth: this.edit.depth});
}
saveList(){
@ -312,7 +312,7 @@ getCardSize() {
}
setConfig(config) {
this.edit = {file: '', hidefooter: false, readonly: false, basic: false, size: 0, ext: '', orgCode: '', coder:1, ...config};
this.edit = {file: '', hidefooter: false, readonly: false, basic: false, size: 0, depth: 2, ext: '', orgCode: '', coder:1, ...config};
if(this.edit.file){
const f=this.edit.file.split('.')[1];
if(f){