1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-13 17:16:48 +00:00

Allow drafts typing timeout to be configured

This commit is contained in:
Jermolene 2015-05-11 20:15:42 +01:00
parent 42a3e31b1b
commit b5ad255d0c
2 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,7 @@ var PAGE_STYLESHEET_TITLE = "$:/core/ui/PageStylesheet";
var PAGE_TEMPLATE_TITLE = "$:/core/ui/PageTemplate";
// Time (in ms) that we defer refreshing changes to draft tiddlers
var DRAFT_TIDDLER_TIMEOUT_TITLE = "$:/config/Drafts/TypingTimeout";
var DRAFT_TIDDLER_TIMEOUT = 400;
exports.startup = function() {
@ -81,7 +82,11 @@ exports.startup = function() {
}
timerId = null;
if(onlyDraftsHaveChanged) {
timerId = setTimeout(refresh,DRAFT_TIDDLER_TIMEOUT);
var timeout = parseInt($tw.wiki.getTiddlerText(DRAFT_TIDDLER_TIMEOUT_TITLE,""),10);
if(isNaN(timeout)) {
timeout = DRAFT_TIDDLER_TIMEOUT;
}
timerId = setTimeout(refresh,timeout);
$tw.utils.extend(deferredChanges,changes);
} else {
$tw.utils.extend(deferredChanges,changes);

View File

@ -0,0 +1,3 @@
title: $:/config/Drafts/TypingTimeout
400