Added docs for action-confirm widget, added default message for widget and improved logic for disabling it. (#5047)

This commit is contained in:
saqimtiaz
2020-11-16 17:02:22 +00:00
committed by GitHub
parent fc1721709a
commit d6e055368d
3 changed files with 44 additions and 3 deletions
+3 -3
View File
@@ -36,8 +36,8 @@ ConfirmWidget.prototype.render = function(parent,nextSibling) {
Compute the internal state of the widget
*/
ConfirmWidget.prototype.execute = function() {
this.message = this.getAttribute("$message");
this.prompt = (this.getAttribute("$prompt","yes") == "yes" ? true : false);
this.message = this.getAttribute("$message",$tw.language.getString("ConfirmAction"));
this.prompt = (this.getAttribute("$prompt","yes") == "no" ? false : true);
this.makeChildWidgets();
};
@@ -59,7 +59,7 @@ Invoke the action associated with this widget
ConfirmWidget.prototype.invokeAction = function(triggeringWidget,event) {
var invokeActions = true,
handled = true;
if(this.message && this.prompt) {
if(this.prompt) {
invokeActions = confirm(this.message);
}
if(invokeActions) {