1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Undo #3490 - error in popup-cancelling logic (#3586)

This commit is contained in:
BurningTreeC 2018-11-29 10:49:11 +01:00 committed by Jeremy Ruston
parent 907d498baf
commit 0396af849a

View File

@ -110,31 +110,10 @@ Popup.prototype.popupInfo = function(domNode) {
Display a popup by adding it to the stack
*/
Popup.prototype.show = function(options) {
var cancelLevel;
// Cancel any popups who aren't an ancestor of the current node
for(var t=0; t<this.popups.length; t++) {
var popup = this.popups[t];
var node = options.domNode;
var isFound = false;
while(node) {
if(node == popup.domNode) {
isFound = true;
break;
}
node = node.parentNode;
}
if(!isFound) {
cancelLevel = t;
break;
}
}
if(cancelLevel !== undefined) {
this.cancel(cancelLevel);
}
// Find out what was clicked on
var info = this.popupInfo(options.domNode);
// Cancel any higher level popups
this.cancel(info.popupLevel);
// Store the popup details if not already there
if(!options.floating && this.findPopup(options.title) === -1) {