mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-09 17:00:27 +00:00
55 lines
1.3 KiB
JavaScript
Executable File
55 lines
1.3 KiB
JavaScript
Executable File
/*\
|
|
title: $:/core/modules/widgets/Void.js
|
|
type: application/javascript
|
|
module-type: widget
|
|
|
|
Void widget that is not intended for render. It still renders all its children.
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
|
|
|
var VoidNodeWidget = function(parseTreeNode,options) {
|
|
this.initialise(parseTreeNode,options);
|
|
};
|
|
|
|
/*
|
|
Inherit from the base widget class
|
|
*/
|
|
VoidNodeWidget.prototype = new Widget();
|
|
|
|
/*
|
|
Render this widget into the DOM
|
|
*/
|
|
VoidNodeWidget.prototype.render = function(parent,nextSibling) {
|
|
// Nothing to do for a void node, but render the children. Nodes generated by pragma rules are holding everything below it in the children.
|
|
this.parentDomNode = parent;
|
|
this.computeAttributes()
|
|
this.execute();
|
|
this.renderChildren(parent,nextSibling);
|
|
};
|
|
|
|
/*
|
|
Compute the internal state of the widget
|
|
*/
|
|
VoidNodeWidget.prototype.execute = function() {
|
|
// Nothing to do for a void node, but construct the child widgets
|
|
this.makeChildWidgets();
|
|
};
|
|
|
|
/*
|
|
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
|
*/
|
|
VoidNodeWidget.prototype.refresh = function(changedTiddlers) {
|
|
return this.refreshChildren(changedTiddlers);
|
|
};
|
|
|
|
exports.void = VoidNodeWidget;
|
|
|
|
})();
|