summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorGabriel Luong2013-06-14 04:25:27 (EDT)
committer Mark Macdonald2013-06-14 10:32:00 (EDT)
commitef61322468444ff91121fe14967a80a71194f69e (patch)
treec4b16c20377c2e9e7059b6e5e784db2ec79fb0a6
parentc76fb6b207f7072ab80efb8688ff881c19aad6da (diff)
downloadorg.eclipse.orion.client-ef61322468444ff91121fe14967a80a71194f69e.zip
org.eclipse.orion.client-ef61322468444ff91121fe14967a80a71194f69e.tar.gz
org.eclipse.orion.client-ef61322468444ff91121fe14967a80a71194f69e.tar.bz2
Bug 410782 - Tooltip adds extra tooltipTail span each time the tooltip is rendered
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/webui/tooltip.js24
1 files changed, 11 insertions, 13 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/tooltip.js b/bundles/org.eclipse.orion.client.ui/web/orion/webui/tooltip.js
index 4c7811a..de62084 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/tooltip.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/webui/tooltip.js
@@ -1,6 +1,6 @@
/*******************************************************************************
* @license
- * Copyright (c) 2012 IBM Corporation and others.
+ * Copyright (c) 2012, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
@@ -190,17 +190,16 @@ define(['require', 'orion/webui/littlelib'], function(require, lib) {
return false;
}
}
-
-
- this._tail = document.createElement("span"); //$NON-NLS-0$
- this._tail.classList.add("tooltipTailFrom"+position); //$NON-NLS-0$
- if (position === "above" || position === "left") { //$NON-NLS-1$//$NON-NLS-0$
- // tip goes after content
-
- this._tip.appendChild(this._tail);
- } else {
-
- this._tip.insertBefore(this._tail, this._tipInner);
+
+ if (!this._tail) {
+ this._tail = document.createElement("span"); //$NON-NLS-0$
+ this._tail.classList.add("tooltipTailFrom"+position); //$NON-NLS-0$
+ if (position === "above" || position === "left") { //$NON-NLS-1$//$NON-NLS-0$
+ // tip goes after content
+ this._tip.appendChild(this._tail);
+ } else {
+ this._tip.insertBefore(this._tail, this._tipInner);
+ }
}
this._tip.style.top = top + "px"; //$NON-NLS-0$
this._tip.style.left = left + "px"; //$NON-NLS-0$
@@ -276,7 +275,6 @@ define(['require', 'orion/webui/littlelib'], function(require, lib) {
this._tip = null;
this._tipInner = null;
this._tail = null;
-
}
}
};