Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
BZ1049506: IE10 - Make simulation results graphs tree respond to mous…
Browse files Browse the repository at this point in the history
…e-click in IE10
  • Loading branch information
Jeremy Lindop committed Feb 19, 2015
1 parent cc24b35 commit 7735659
Showing 1 changed file with 45 additions and 5 deletions.
Expand Up @@ -94,7 +94,8 @@ ORYX.Plugins.SimulationResults = Clazz.extend({
}
});
var graphType;
var graphTypeChild;
var graphTypeChild;
var graphTypeChildren = [];
this.resultsjson = options.results;
var processSimInfo = jsonPath(options.results.evalJSON(), "$.processsim.*");
if(processSimInfo) {
Expand Down Expand Up @@ -127,7 +128,7 @@ ORYX.Plugins.SimulationResults = Clazz.extend({
}});
graphType.appendChild(graphTypeChild);
graphList.appendChild(graphType);

graphTypeChildren.push(graphTypeChild);
}
var htSimInfo = jsonPath(options.results.evalJSON(), "$.htsim.*");
var taskSimInfo = jsonPath(options.results.evalJSON(), "$.tasksim.*");
Expand Down Expand Up @@ -156,6 +157,7 @@ ORYX.Plugins.SimulationResults = Clazz.extend({
iconCls: window.SpriteUtils.toUniqueId(ORYX.BASE_FILE_PATH + 'images/simulation/activities/User.png'),
singleClickExpand:true});
graphType.appendChild(graphTypeChild);
graphTypeChildren.push(graphTypeChild);
}
for (var j = 0; j < taskSimInfo.length; j++) {
var nextTask = taskSimInfo[j];
Expand All @@ -174,6 +176,7 @@ ORYX.Plugins.SimulationResults = Clazz.extend({
singleClickExpand:true});

graphType.appendChild(graphTypeChild);
graphTypeChildren.push(graphTypeChild);
}
graphList.appendChild(graphType);
}
Expand Down Expand Up @@ -204,11 +207,12 @@ ORYX.Plugins.SimulationResults = Clazz.extend({
icon: ORYX.BASE_FILE_PATH + 'images/simulation/pathicon.png',
singleClickExpand:true});
graphType.appendChild(graphTypeChild);
graphTypeChildren.push(graphTypeChild);
}
graphList.appendChild(graphType);
}
Ext.getCmp('simresultscharts').setRootNode(graphList);

Ext.getCmp('simresultscharts').setRootNode(graphList);
Ext.getCmp('simresultscharts').getRootNode().render();
Ext.getCmp('simresultscharts').el.dom.style.height = '100%';
Ext.getCmp('simresultscharts').el.dom.style.overflow = 'scroll';
Expand All @@ -219,8 +223,44 @@ ORYX.Plugins.SimulationResults = Clazz.extend({
var node = tp.getNodeById("pgraph:processaverages");
node.select();
this._showProcessGraphs("processaverages");

// BZ 1049506 IE mouse events in SimulationGraphs tree don't work, so use DragZone to
// make IE respond to onMouseUp
if ( (Object.hasOwnProperty.call(window, "ActiveXObject") && !window.ActiveXObject) ||
(navigator.appVersion.indexOf("MSIE 10") !== -1) ) {
this.createDragZoneForIE(graphList, graphTypeChildren);
}
},
findTaskType: function(taskid) {

createDragZoneForIE: function(graphList, nodes) {
// Create a Drag-Zone for Drag'n'Drop
var DragZone = new Ext.dd.DragZone(graphList.getUI().getEl(), {shadow: !Ext.isMac});
DragZone.onMouseUp = this.onMouseUpInDragZoneForIE.bind(this, DragZone);

for (i = 0; i < nodes.length; i++) {
var node = nodes[i];
var ui = node.getUI();
// Register the node on Drag and Drop
Ext.dd.Registry.register(ui.elNode, {
node: ui.node,
handles: [ui.elNode, ui.textNode], // Set the Handles
isHandle: false,
id: node.id
});

}
},

onMouseUpInDragZoneForIE: function(e) {
if (e && e.dragData && e.dragData.id) {
//ORYX.Log.info("onMouseUpDragZoneForIE dragData is a " + e.dragData.id + "." );
var options = { value: { id : e.dragData.id}};
this.showGraph(options);
}
},


findTaskType: function(taskid) {
ORYX.EDITOR._canvas.getChildren().each((function(child) {
this.isTaskType(child, taskid);
}).bind(this));
Expand Down

0 comments on commit 7735659

Please sign in to comment.