Extend <-popup> to create floating popups that must be manually cleared (#5655)

new-json-store-area
Saq Imtiaz 2021-05-02 11:20:39 +02:00 zatwierdzone przez GitHub
rodzic cb44cc0f2b
commit 3f98686153
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -37,6 +37,7 @@ Compute the internal state of the widget
ActionPopupWidget.prototype.execute = function() {
this.actionState = this.getAttribute("$state");
this.actionCoords = this.getAttribute("$coords");
this.floating = this.getAttribute("$floating","no") === "yes";
};
/*
@ -68,7 +69,8 @@ ActionPopupWidget.prototype.invokeAction = function(triggeringWidget,event) {
height: parseFloat(match[4])
},
title: this.actionState,
wiki: this.wiki
wiki: this.wiki,
floating: this.floating
});
} else {
$tw.popup.cancel(0);

Wyświetl plik

@ -1,6 +1,6 @@
caption: action-popup
created: 20200303114556528
modified: 20200421221304177
modified: 20210501203451387
tags: Widgets ActionWidgets
title: ActionPopupWidget
type: text/vnd.tiddlywiki
@ -16,9 +16,12 @@ The ''action-popup'' widget is invisible. Any content within it is ignored.
|!Attribute |!Description |
|$state |The title of the state tiddler for the popup |
|$coords |Optional coordinates for the handle to which popup is positioned (in the format `(x,y,w,h)`) |
|$floating |<<.from-version "5.1.24">> Optional. Defaults to `no`. Set to `yes` to create a popup that must be closed explicitly. |
<<.from-version "5.1.23">> If the ''$coords'' attribute is missing or empty then all popups are cancelled.
<<.tip "Delete the state tiddler for a floating popup to close it.">>
! Examples
Here is an example of button that triggers the "more" button in the sidebar "Tools" tab. You may need to scroll to see the popup