Pop-up ajax node info panel - fix for multiple clicks

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5370 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-03-09 14:09:46 +00:00
parent 6c55744e4b
commit 3cbc7ce030

View File

@@ -93,33 +93,39 @@ Alfresco.NodeInfoPanel.prototype =
launchElement: null, launchElement: null,
popupElement: null, popupElement: null,
visible: false, visible: false,
loading: false,
/** /**
* Makes the AJAX request back to the server to get the node info. * Makes the AJAX request back to the server to get the node info.
*/ */
showNodeInfo: function() showNodeInfo: function()
{ {
if (this.popupElement == null) if (this.loading == false)
{ {
var elImg = Alfresco.Dom.getElementByTagName(this.launchElement, "img"); if (this.popupElement == null)
if (elImg != null)
{ {
elImg.src = getContextPath() + "/images/icons/ajax_anim.gif"; this.loading = true;
var elImg = Alfresco.Dom.getElementByTagName(this.launchElement, "img");
if (elImg != null)
{
elImg.src = getContextPath() + "/images/icons/ajax_anim.gif";
}
YAHOO.util.Connect.asyncRequest(
"POST",
getContextPath() + '/ajax/invoke/NodeInfoBean.sendNodeInfo',
{
success: this.loadNodeInfoHandler,
failure: handleErrorYahoo, // global error handler
argument: [this.nodeRef, this]
},
"noderef=" + this.nodeRef);
}
else
{
this.displayNodeInfo();
} }
YAHOO.util.Connect.asyncRequest(
"POST",
getContextPath() + '/ajax/invoke/NodeInfoBean.sendNodeInfo',
{
success: this.loadNodeInfoHandler,
failure: handleErrorYahoo, // global error handler
argument: [this.nodeRef, this]
},
"noderef=" + this.nodeRef);
}
else
{
this.displayNodeInfo();
} }
}, },
@@ -148,6 +154,7 @@ Alfresco.NodeInfoPanel.prototype =
// keep track of the div element we created // keep track of the div element we created
panel.popupElement = div; panel.popupElement = div;
panel.loading = false;
// display the div for the first time // display the div for the first time
panel.displayNodeInfo(); panel.displayNodeInfo();