From 1a4c114ecb4b3bc42f74887315320dd858be1d04 Mon Sep 17 00:00:00 2001 From: pmario Date: Thu, 25 Apr 2024 15:18:54 +0200 Subject: [PATCH] add parent-ancestorcount-dom macro --- .../macros/parent-ancestorcount-dom.js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 core/modules/macros/parent-ancestorcount-dom.js diff --git a/core/modules/macros/parent-ancestorcount-dom.js b/core/modules/macros/parent-ancestorcount-dom.js new file mode 100644 index 000000000..e7e428058 --- /dev/null +++ b/core/modules/macros/parent-ancestorcount-dom.js @@ -0,0 +1,26 @@ +/*\ +title: $:/core/modules/macros/parent-ancestorcount-dom.js +type: application/javascript +module-type: macro + +Macro to return the parent widget this.ancestors variable + +\*/ +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +/* +Information about this macro +*/ + +exports.name = "parent-ancestorcount-dom"; + +exports.params = []; + +/* +Run the macro +*/ +exports.run = function() { + return (this.parentWidget) ? this.parentWidget.getAncestorCountDom() + "" : ""; +};