Skip to content

Commit fc96672

Browse files
committed
Support of fast buttons in DABC server and web browser
git-svn-id: https://subversion.gsi.de/dabc/trunk/plugins/root/js@2700 bcbf6573-9a26-0410-9ebc-ce4ab7aade96
1 parent 745b93a commit fc96672

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

scripts/JSRootCore.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
return dflt;
154154
}
155155

156-
JSROOT.NewHttpRequest = function(url, kind, callback) {
156+
JSROOT.NewHttpRequest = function(url, kind, user_call_back) {
157157
// Create asynchronous XMLHttpRequest object.
158158
// One should call req.send() to submit request
159159
// kind of the request can be:
@@ -164,6 +164,11 @@
164164
// "head" - returns request itself, uses "HEAD" method
165165
// Result will be returned to the callback functions
166166
// If failed, request returns null
167+
168+
function callback(res) {
169+
if (typeof user_call_back == 'function') user_call_back(res);
170+
}
171+
167172
var xhr = new XMLHttpRequest();
168173

169174
// if (typeof ActiveXObject == "function") {

scripts/JSRootPainter.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7446,31 +7446,27 @@
74467446
}
74477447
}
74487448

7449-
JSROOT.HierarchyPainter.prototype.OpenOnline = function(server_address,
7450-
user_callback) {
7451-
if (!server_address)
7452-
server_address = "";
7449+
JSROOT.HierarchyPainter.prototype.OpenOnline = function(server_address, user_callback) {
7450+
if (!server_address) server_address = "";
74537451

74547452
var painter = this;
74557453

7456-
var req = JSROOT.NewHttpRequest(server_address + "h.json?compact=3",
7457-
'object', function(result) {
7458-
painter.h = result;
7459-
if (painter.h == null)
7460-
return;
7454+
var req = JSROOT.NewHttpRequest(server_address + "h.json?compact=3", 'object', function(result) {
7455+
painter.h = result;
7456+
if (painter.h == null) return;
74617457

7462-
// mark top hierarchy as online data and
7463-
painter.h['_online'] = server_address;
7458+
// mark top hierarchy as online data and
7459+
painter.h['_online'] = server_address;
74647460

7465-
painter.AddOnlineMethods(painter.h);
7461+
painter.AddOnlineMethods(painter.h);
74667462

7467-
if (painter.h != null)
7468-
painter.RefreshHtml(true);
7463+
if (painter.h != null)
7464+
painter.RefreshHtml(true);
74697465

7470-
if (typeof user_callback == 'function')
7471-
user_callback(painter);
7466+
if (typeof user_callback == 'function')
7467+
user_callback(painter);
74727468

7473-
});
7469+
});
74747470

74757471
req.send(null);
74767472
}

0 commit comments

Comments
 (0)