File tree Expand file tree Collapse file tree 2 files changed +19
-18
lines changed Expand file tree Collapse file tree 2 files changed +19
-18
lines changed Original file line number Diff line number Diff line change 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:
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") {
Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments