diff --git a/scripts/JSRootGeoPainter.js b/scripts/JSRootGeoPainter.js
index e4560ee9f..d30ad68fd 100644
--- a/scripts/JSRootGeoPainter.js
+++ b/scripts/JSRootGeoPainter.js
@@ -1023,14 +1023,11 @@
this._renderer.domElement._translationSnap = Math.ceil( overall_size ) / 50;
if ( this._renderer.domElement.transformControl !== null )
this._renderer.domElement.transformControl.attach( toplevel );
- if (typeof JSROOT.progress === "function") {
- JSROOT.progress();
- JSROOT.progress("
Transform Controls" +
- "'T' translate | 'R' rotate | 'S' scale" +
- "'+' increase size | '-' decrease size" +
- "'W' toggle wireframe/solid display"+
- "keep 'Ctrl' down to snap to grid");
- }
+ this.helpText("Transform Controls
" +
+ "'T' translate | 'R' rotate | 'S' scale
" +
+ "'+' increase size | '-' decrease size
" +
+ "'W' toggle wireframe/solid display
"+
+ "keep 'Ctrl' down to snap to grid");
}
this._camera.near = overall_size / 200;
this._camera.far = overall_size * 500;
@@ -1057,37 +1054,61 @@
dom.onclick = function(e) {
this.focus();
};
- //dom.onmouseenter = function(e) {
- // this.focus();
- //};
- //dom.onmouseleave = function(e) {
- // this.blur();
- //};
- dom.onremove = function () {
- if (pthis._scene === null ) return;
-
- pthis._renderer.domElement.clock = null;
- if (pthis._renderer.domElement._timeoutFunc != null)
- clearTimeout( pthis._renderer.domElement._timeoutFunc );
- if (pthis._renderer.domElement._animationId != null)
- cancelAnimationFrame( pthis._renderer.domElement._animationId );
-
- pthis.deleteChildren(pthis._scene);
- pthis._renderer.initWebGLObjects(pthis._scene);
- delete pthis._scene;
- pthis._scene = null;
- if ( pthis._renderer.domElement.transformControl !== null )
- pthis._renderer.domElement.transformControl.dispose();
- pthis._renderer.domElement.transformControl = null;
- pthis._renderer.domElement.trackballControls = null;
- pthis._renderer.domElement.render = null;
- pthis._renderer = null;
- pthis = null;
- };
return this.DrawingReady();
}
+ JSROOT.TGeoPainter.prototype.Cleanup = function() {
+ this.helpText();
+ if (this._scene === null ) return;
+
+ this._renderer.domElement.clock = null;
+ if (this._renderer.domElement._timeoutFunc != null)
+ clearTimeout( this._renderer.domElement._timeoutFunc );
+ if (this._renderer.domElement._animationId != null)
+ cancelAnimationFrame( this._renderer.domElement._animationId );
+
+ this.deleteChildren(this._scene);
+ //this._renderer.initWebGLObjects(this._scene);
+ delete this._scene;
+ this._scene = null;
+ if ( this._renderer.domElement.transformControl !== null )
+ this._renderer.domElement.transformControl.dispose();
+ this._renderer.domElement.transformControl = null;
+ this._renderer.domElement.trackballControls = null;
+ this._renderer.domElement.render = null;
+ this._renderer = null;
+ }
+
+ JSROOT.TGeoPainter.prototype.helpText = function(msg) {
+ var id = "jsroot_helptext";
+ var box = d3.select("#"+id);
+ var newmsg = true;
+ if ((typeof msg == "undefined") || (msg==null)) {
+ if (box.empty())
+ return;
+ box.property('stack').pop();
+ if (box.property('stack').length==0)
+ return box.remove();
+ msg = box.property('stack')[box.property('stack').length-1]; // show prvious message
+ newmsg = false;
+ }
+ if (box.empty()) {
+ box = d3.select(document.body)
+ .append("div")
+ .attr("id", id)
+ .attr("class","progressbox")
+ .property("stack",new Array);
+
+ box.append("p");
+ }
+ box.select("p").html(msg);
+ if (newmsg) {
+ box.property('stack').push(msg);
+ box.property("showtm", new Date);
+ }
+ }
+
JSROOT.TGeoPainter.prototype.CheckResize = function(size) {
var rect = this.select_main().node().getBoundingClientRect();
diff --git a/scripts/JSRootPainter.js b/scripts/JSRootPainter.js
index b846e18fa..01c3bec3c 100644
--- a/scripts/JSRootPainter.js
+++ b/scripts/JSRootPainter.js
@@ -7613,8 +7613,8 @@
JSROOT.MDIDisplay.prototype.Reset = function() {
this.ForEachPainter(function(painter) {
- if ((painter.GetItemName()!=null) && (typeof painter['Clenaup'] == 'function'))
- painter.Clenaup();
+ if ((painter.GetItemName()!=null) && (typeof painter['Cleanup'] == 'function'))
+ painter.Cleanup();
});
d3.select("#"+this.frameid).html('').property('mdi', null);