mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-29 23:40:45 +00:00
Ensured we remove the popup click handler
This commit is contained in:
parent
5103f1585b
commit
84b6020f2a
@ -37,14 +37,14 @@ exports.triggerPopup = function(event,cancel) {
|
|||||||
}
|
}
|
||||||
// Check for cancelling
|
// Check for cancelling
|
||||||
if(cancel) {
|
if(cancel) {
|
||||||
this.wiki.deleteTextReference(textRef,this.tiddlerTitle);
|
$tw.popupper.cancel();
|
||||||
} else {
|
} else {
|
||||||
// Get the current popup state tiddler
|
// Get the current popup state tiddler
|
||||||
var value = this.wiki.getTextReference(textRef,"",this.tiddlerTitle);
|
var value = this.wiki.getTextReference(textRef,"",this.tiddlerTitle);
|
||||||
// Check if the popup is open by checking whether it matches "(<x>,<y>)"
|
// Check if the popup is open by checking whether it matches "(<x>,<y>)"
|
||||||
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/;
|
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/;
|
||||||
if(popupLocationRegExp.test(value)) {
|
if(popupLocationRegExp.test(value)) {
|
||||||
this.wiki.deleteTextReference(textRef,this.tiddlerTitle);
|
$tw.popupper.cancel();
|
||||||
} else {
|
} else {
|
||||||
// Set the position if we're opening it
|
// Set the position if we're opening it
|
||||||
this.wiki.setTextReference(textRef,
|
this.wiki.setTextReference(textRef,
|
||||||
|
@ -33,6 +33,7 @@ Popupper.prototype.popup = function(stateTextRef) {
|
|||||||
|
|
||||||
Popupper.prototype.handleEvent = function(event) {
|
Popupper.prototype.handleEvent = function(event) {
|
||||||
if(event.type === "click") {
|
if(event.type === "click") {
|
||||||
|
this.rootElement.removeEventListener("click",this,true);
|
||||||
this.cancel();
|
this.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user