2022-04-26 13:36:05 +00:00
/ * \
title : $ : / c o r e / m o d u l e s / w i d g e t s / v a l u e . j s
type : application / javascript
module - type : widget
2022-04-30 09:00:38 +00:00
Sub - widget used by the transclude widget for specifying values for slots within transcluded content . It doesn 't do anything by itself because the transclude widget only ever deals with the parse tree nodes, and doesn' t instantiate the widget itself
2022-04-26 13:36:05 +00:00
\ * /
( function ( ) {
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict" ;
var Widget = require ( "$:/core/modules/widgets/widget.js" ) . widget ;
2022-05-13 08:18:25 +00:00
var FillWidget = function ( parseTreeNode , options ) {
2022-04-26 13:36:05 +00:00
// Initialise
this . initialise ( parseTreeNode , options ) ;
} ;
/ *
Inherit from the base widget class
* /
2022-05-13 08:18:25 +00:00
FillWidget . prototype = Object . create ( Widget . prototype ) ;
2022-04-26 13:36:05 +00:00
/ *
Render this widget into the DOM
* /
2022-05-13 08:18:25 +00:00
FillWidget . prototype . render = function ( parent , nextSibling ) {
2022-04-26 13:36:05 +00:00
// Call the constructor
Widget . call ( this ) ;
this . parentDomNode = parent ;
this . computeAttributes ( ) ;
this . execute ( ) ;
this . renderChildren ( parent , nextSibling ) ;
} ;
/ *
Compute the internal state of the widget
* /
2022-05-13 08:18:25 +00:00
FillWidget . prototype . execute = function ( ) {
2022-04-26 13:36:05 +00:00
// Construct the child widgets
this . makeChildWidgets ( ) ;
} ;
/ *
Refresh the widget by ensuring our attributes are up to date
* /
2022-05-13 08:18:25 +00:00
FillWidget . prototype . refresh = function ( changedTiddlers ) {
2022-04-26 13:36:05 +00:00
return this . refreshChildren ( changedTiddlers ) ;
} ;
2022-05-13 08:18:25 +00:00
exports . fill = FillWidget ;
2022-04-26 13:36:05 +00:00
} ) ( ) ;