1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-10 15:53:58 +00:00

rename widget-ancestorcount to parent-ancestorcount

This commit is contained in:
pmario 2024-04-17 10:41:13 +02:00
parent f50c5bc0c4
commit 6e7ccfa9fa
2 changed files with 6 additions and 6 deletions

View File

@ -1,9 +1,9 @@
/*\
title: $:/core/modules/macros/widget-ancestorcount.js
title: $:/core/modules/macros/parent-ancestorcount.js
type: application/javascript
module-type: macro
Macro to return the widget this.ancestors variable
Macro to return the parent widget this.ancestors variable
\*/
/*jslint node: true, browser: true */
@ -14,7 +14,7 @@ Macro to return the widget this.ancestors variable
Information about this macro
*/
exports.name = "widget-ancestorcount";
exports.name = "parent-ancestorcount";
exports.params = [];
@ -22,5 +22,5 @@ exports.params = [];
Run the macro
*/
exports.run = function() {
return this.getAncestorCount() + "" || "";
return (this.parentWidget) ? this.parentWidget.getAncestorCount() + "" : "";
};

View File

@ -1,12 +1,12 @@
created: 20240417070900019
modified: 20240417082244189
modified: 20240417083823331
tags:
title: test-new-set-get-macros
type: text/vnd.tiddlywiki
\import test-collatz
ancestor count: <<widget-ancestorcount>>
ancestor count: <<parent-ancestorcount>>
UNSAFE_max_widget_tree_depth: <<get_UNSAFE_max_widget_tree_depth>>