mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-05 18:37:52 +00:00
Keyboard-driven dropdown inputs (#4725)
* Add shortcut descriptions to Misc.multids * Update framed.js * Update simple.js * Add inputActions and refreshTitle to factory.js * Add inputActions and refreshTitle to edit.js * Update DefaultSearchResultList.tid * Update search.tid * Update ShortcutInfo.multids * Update shortcuts.multids * Create keyboard-driven-input.tid * Update tag-picker.tid * Create keyboard-driven-input_Macro.tid * Update EditTextWidget.tid * Update EditWidget.tid * Update engine.js * Update base.tid * Use primaryListFilter, secondaryListFilter, primaryList and secondaryList * Update tag-picker.tid * Update search.tid * Update DefaultSearchResultList.tid * Update keyboard-driven-input_Macro.tid * Fix typo udpate -> update * Update framed.js
This commit is contained in:
@@ -120,6 +120,9 @@ function CodeMirrorEngine(options) {
|
||||
// Set up a change event handler
|
||||
this.cm.on("change",function() {
|
||||
self.widget.saveChanges(self.getText());
|
||||
if(self.widget.editInputActions) {
|
||||
self.widget.invokeActionString(self.widget.editInputActions);
|
||||
}
|
||||
});
|
||||
this.cm.on("drop",function(cm,event) {
|
||||
event.stopPropagation(); // Otherwise TW's dropzone widget sees the drop event
|
||||
@@ -142,10 +145,17 @@ CodeMirrorEngine.prototype.setText = function(text,type) {
|
||||
var self = this;
|
||||
self.cm.setOption("mode",type);
|
||||
if(!this.cm.hasFocus()) {
|
||||
this.cm.setValue(text);
|
||||
this.updateDomNodeText(text);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Update the DomNode with the new text
|
||||
*/
|
||||
CodeMirrorEngine.prototype.updateDomNodeText = function(text) {
|
||||
this.cm.setValue(text);
|
||||
};
|
||||
|
||||
/*
|
||||
Get the text of the engine
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user