1
0
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:
Rizwan
2018-04-03 00:09:59 +05:30
committed by Jeremy Ruston
parent a8bd22f363
commit 501ad2798f
2 changed files with 7 additions and 2 deletions

View File

@@ -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;
})();
})();