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

logging-improvements
BurningTreeC 2018-11-29 10:49:11 +01:00 zatwierdzone przez Jeremy Ruston
rodzic 907d498baf
commit 0396af849a
1 zmienionych plików z 4 dodań i 25 usunięć

Wyświetl plik

@ -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) {