1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-18 07:44:51 +00:00

Parameters widget: protect against negative $depth

This commit is contained in:
jeremy@jermolene.com 2022-09-09 12:04:50 +01:00
parent 82b22523aa
commit b751f7e793

View File

@ -42,7 +42,7 @@ Compute the internal state of the widget
*/ */
ParametersWidget.prototype.execute = function() { ParametersWidget.prototype.execute = function() {
var self = this; var self = this;
this.parametersDepth = parseInt(this.getAttribute("$depth","1"),10) || 1; this.parametersDepth = Math.max(parseInt(this.getAttribute("$depth","1"),10) || 1,1);
// Find the parent transclusions // Find the parent transclusions
var pointer = this.parentWidget, var pointer = this.parentWidget,
depth = this.parametersDepth; depth = this.parametersDepth;