mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-20 10:17:38 +00:00
Add ability to trigger actions on unchecking checkbox widget (#3182)
* Add uncheck-actions to checkbox widget * Update checkbox.js * Docs for "uncheckactions" param of checkbox widget
This commit is contained in:
@@ -156,6 +156,9 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
||||
if(this.checkboxActions) {
|
||||
this.invokeActionString(this.checkboxActions,this,event);
|
||||
}
|
||||
if(this.checkboxUncheckActions && !checked) {
|
||||
this.invokeActionString(this.checkboxUncheckActions,this,event);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -164,6 +167,7 @@ Compute the internal state of the widget
|
||||
CheckboxWidget.prototype.execute = function() {
|
||||
// Get the parameters from the attributes
|
||||
this.checkboxActions = this.getAttribute("actions");
|
||||
this.checkboxUncheckActions = this.getAttribute("uncheckactions");
|
||||
this.checkboxTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.checkboxTag = this.getAttribute("tag");
|
||||
this.checkboxField = this.getAttribute("field");
|
||||
@@ -197,4 +201,4 @@ CheckboxWidget.prototype.refresh = function(changedTiddlers) {
|
||||
|
||||
exports.checkbox = CheckboxWidget;
|
||||
|
||||
})();
|
||||
})();
|
||||
|
Reference in New Issue
Block a user