summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiteshjha2016-06-17 10:10:04 +0530
committerjiteshjha2016-06-17 10:10:04 +0530
commit19facb6a9a80f5c7edd2235e6fea8634e7c55a27 (patch)
treeeb7a0bee0099bcac561113b69bbbbd8778f94964
parent4c9937556717378e009595162f80b2d19ea76ce5 (diff)
downloadxcos-on-web-19facb6a9a80f5c7edd2235e6fea8634e7c55a27.tar.gz
xcos-on-web-19facb6a9a80f5c7edd2235e6fea8634e7c55a27.tar.bz2
xcos-on-web-19facb6a9a80f5c7edd2235e6fea8634e7c55a27.zip
Added necessary code for labels to work
-rw-r--r--index.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/index.html b/index.html
index 075346d..ebca018 100644
--- a/index.html
+++ b/index.html
@@ -327,6 +327,38 @@
mxEvent.consume(evt);
};
+ // Returns a shorter label if the cell is collapsed and no
+ // label for expanded groups
+ graph.getLabel = function(cell) {
+ var tmp = mxGraph.prototype.getLabel.apply(this, arguments); // "supercall"
+ if (this.isCellLocked(cell)) {
+ // Returns an empty label but makes sure an HTML
+ // element is created for the label (for event
+ // processing wrt the parent label)
+ return '';
+ } else if (this.isCellCollapsed(cell)) {
+ var index = tmp.indexOf('</h1>');
+ if (index > 0) {
+ tmp = tmp.substring(0, index + 5);
+ }
+ }
+ return tmp;
+ }
+
+ // Disables HTML labels for swimlanes to avoid conflict
+ // for the event processing on the child cells. HTML
+ // labels consume events before underlying cells get the
+ // chance to process those events.
+ //
+ // NOTE: Use of HTML labels is only recommended if the specific
+ // features of such labels are required, such as special label
+ // styles or interactive form fields. Otherwise non-HTML labels
+ // should be used by not overidding the following function.
+ // See also: configureStylesheet.
+ graph.isHtmlLabel = function(cell) {
+ return !this.isSwimlane(cell);
+ }
+
graph.getTooltipForCell = function(cell) {
var text = null;
if (cell.isVertex() == true && cell.isConnectable() == false) {