mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-16 23:01:23 +00:00
ActionPopup widget: Add ability to cancel all popups
This commit is contained in:
@@ -57,7 +57,7 @@ Invoke the action associated with this widget
|
||||
ActionPopupWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
// Trigger the popup
|
||||
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/,
|
||||
match = popupLocationRegExp.exec(this.actionCoords);
|
||||
match = popupLocationRegExp.exec(this.actionCoords || "");
|
||||
if(match) {
|
||||
$tw.popup.triggerPopup({
|
||||
domNode: null,
|
||||
@@ -70,6 +70,8 @@ ActionPopupWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
title: this.actionState,
|
||||
wiki: this.wiki
|
||||
});
|
||||
} else {
|
||||
$tw.popup.cancel(0);
|
||||
}
|
||||
return true; // Action was invoked
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user