1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-13 22:07:15 +00:00

Allow configuration of default focus field of new tiddlers (#4238)

* add editFocus attribute to edit widget

* add focus condition to title editTemplate

* add focus condition to body-editor editTemplate

* add focus attribute to type editTemplate

* add focus attribute to fields editTemplate

* add focus attribute to tag-picker

* add $:/config/AutoFocus tiddler

... default focus is title

* Update Basics.tid

* Update ControlPanel.multids

* Create minifocusswitcher.tid

* Update minifocusswitcher.tid

* Update Basics.tid

* Update body-editor.tid
This commit is contained in:
Simon Huber
2019-10-12 13:04:10 +02:00
committed by Jeremy Ruston
parent 74172b35ce
commit 66b68f4a58
10 changed files with 19 additions and 5 deletions

View File

@@ -47,6 +47,7 @@ EditWidget.prototype.execute = function() {
this.editClass = this.getAttribute("class");
this.editPlaceholder = this.getAttribute("placeholder");
this.editTabIndex = this.getAttribute("tabindex");
this.editFocus = this.getAttribute("focus","");
// Choose the appropriate edit widget
this.editorType = this.getEditorType();
// Make the child widgets
@@ -58,7 +59,8 @@ EditWidget.prototype.execute = function() {
index: {type: "string", value: this.editIndex},
"class": {type: "string", value: this.editClass},
"placeholder": {type: "string", value: this.editPlaceholder},
"tabindex": {type: "string", value: this.editTabIndex}
"tabindex": {type: "string", value: this.editTabIndex},
"focus": {type: "string", value: this.editFocus}
},
children: this.parseTreeNode.children
}]);