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

Adding optional tabindex attr to simple, framed and cm engines (#3756)

* add optional tabindex attribute to factory.js

* add changedAttributes.tabindex to refresh mechanic

* add optional tabindex attribute to edit widget

* remove some extra whitespace

* remove some trailing whitespace

* add optional tabindex attribute to simple engine

* add optional tabindex attribute to framed engine

* add optional tabindex attribute to cm engine
This commit is contained in:
Simon Huber
2019-02-08 17:11:39 +01:00
committed by Jeremy Ruston
parent 9d7d3fefa0
commit f97d18bb6e
5 changed files with 18 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ EditWidget.prototype.execute = function() {
this.editIndex = this.getAttribute("index");
this.editClass = this.getAttribute("class");
this.editPlaceholder = this.getAttribute("placeholder");
this.editTabIndex = this.getAttribute("tabindex");
// Choose the appropriate edit widget
this.editorType = this.getEditorType();
// Make the child widgets
@@ -56,7 +57,8 @@ EditWidget.prototype.execute = function() {
field: {type: "string", value: this.editField},
index: {type: "string", value: this.editIndex},
"class": {type: "string", value: this.editClass},
"placeholder": {type: "string", value: this.editPlaceholder}
"placeholder": {type: "string", value: this.editPlaceholder},
"tabindex": {type: "string", value: this.editTabIndex}
},
children: this.parseTreeNode.children
}]);
@@ -90,11 +92,11 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
EditWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
// Refresh if an attribute has changed, or the type associated with the target tiddler has changed
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) {
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tabindex || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) {
this.refreshSelf();
return true;
} else {
return this.refreshChildren(changedTiddlers);
return this.refreshChildren(changedTiddlers);
}
};