mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Add a hack to switch slowmo animation mode
Just type `$tw.slowmo()` in the developer console to engage slowmo mode.
This commit is contained in:
parent
1304bfd0d4
commit
ea8c795d01
27
core/modules/hacks.js
Normal file
27
core/modules/hacks.js
Normal file
@ -0,0 +1,27 @@
|
||||
/*\
|
||||
title: $:/core/modules/hacks.js
|
||||
type: application/javascript
|
||||
module-type: global
|
||||
|
||||
These functions are designed to be invoked in the browser developer tools or the node.js REPL.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Switch slowmotion animation mode on or off
|
||||
*/
|
||||
exports.slowmo = function(status) {
|
||||
if(status === undefined || status) {
|
||||
$tw.config.preferences.animationDuration = 4000;
|
||||
} else {
|
||||
$tw.config.preferences.animationDuration = 400;
|
||||
}
|
||||
$tw.config.preferences.animationDurationMs = $tw.config.preferences.animationDuration + "ms";
|
||||
};
|
||||
|
||||
})();
|
Loading…
Reference in New Issue
Block a user