mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-28 15:08:46 +00:00
parent
907d498baf
commit
0396af849a
@ -110,31 +110,10 @@ Popup.prototype.popupInfo = function(domNode) {
|
|||||||
Display a popup by adding it to the stack
|
Display a popup by adding it to the stack
|
||||||
*/
|
*/
|
||||||
Popup.prototype.show = function(options) {
|
Popup.prototype.show = function(options) {
|
||||||
var cancelLevel;
|
// Find out what was clicked on
|
||||||
// Cancel any popups who aren't an ancestor of the current node
|
var info = this.popupInfo(options.domNode);
|
||||||
for(var t=0; t<this.popups.length; t++) {
|
// Cancel any higher level popups
|
||||||
var popup = this.popups[t];
|
this.cancel(info.popupLevel);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store the popup details if not already there
|
// Store the popup details if not already there
|
||||||
if(!options.floating && this.findPopup(options.title) === -1) {
|
if(!options.floating && this.findPopup(options.title) === -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user