1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Allow field modules to specify HTML element tag used for editing

This commit is contained in:
Jeremy Ruston 2013-11-07 19:39:50 +00:00
parent e5b66a08bf
commit 69888e6701
2 changed files with 4 additions and 0 deletions

View File

@ -700,6 +700,7 @@ $tw.modules.define("$:/boot/tiddlerfields/created","tiddlerfield",{
});
$tw.modules.define("$:/boot/tiddlerfields/color","tiddlerfield",{
name: "color",
editTag: "input",
editType: "color"
});
$tw.modules.define("$:/boot/tiddlerfields/tags","tiddlerfield",{

View File

@ -122,6 +122,9 @@ EditTextWidget.prototype.execute = function() {
} else {
tag = "input";
var fieldModule = $tw.Tiddler.fieldModules[this.editField];
if(fieldModule && fieldModule.editTag) {
tag = fieldModule.editTag;
}
if(fieldModule && fieldModule.editType) {
type = fieldModule.editType;
}