kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Extend <-popup> to create floating popups that must be manually cleared (#5655)
rodzic
cb44cc0f2b
commit
3f98686153
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue