mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-22 23:16:53 +00:00
Allow drafts typing timeout to be configured
This commit is contained in:
parent
42a3e31b1b
commit
b5ad255d0c
@ -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);
|
||||
|
3
core/wiki/config/Drafts-TypingTimeout.tid
Normal file
3
core/wiki/config/Drafts-TypingTimeout.tid
Normal file
@ -0,0 +1,3 @@
|
||||
title: $:/config/Drafts/TypingTimeout
|
||||
|
||||
400
|
Loading…
Reference in New Issue
Block a user