@@ -302,11 +302,11 @@ export default class Context {
302
302
*/
303
303
setUpLuts ( ) {
304
304
$ . ajax (
305
- { url : this . server + this . getPrefixedURI ( IVIEWER ) + "/is_dynamic_lut /" ,
305
+ { url : this . server + this . getPrefixedURI ( WEBGATEWAY ) + "/luts /" ,
306
306
success : ( response ) => {
307
307
// Check first whether omero-web can provides LUT dynamically
308
308
// and set URL accordingly
309
- let is_dynamic_lut = response . is_dynamic_lut ;
309
+ let is_dynamic_lut = Boolean ( response . png_luts_new ) ;
310
310
if ( is_dynamic_lut ) {
311
311
this . luts_png . url =
312
312
this . server + this . getPrefixedURI ( WEBGATEWAY , false ) + "/luts_png/" ;
@@ -324,33 +324,22 @@ export default class Context {
324
324
}
325
325
lutsPng . src = this . luts_png . url ;
326
326
327
- // now query the luts list
328
- let server = this . server ;
329
- let uri_prefix = this . getPrefixedURI ( WEBGATEWAY ) ;
330
- $ . ajax (
331
- { url : server + uri_prefix + "/luts/" ,
332
- success : ( response ) => {
333
- if ( typeof response !== 'object' || response === null ||
334
- ! Misc . isArray ( response . luts ) ) return ;
335
-
336
- if ( is_dynamic_lut ) {
337
- // If it's dynamic, uses the new list instead
338
- response . png_luts = response . png_luts_new
339
- }
327
+ if ( is_dynamic_lut ) {
328
+ // If it's dynamic, uses the new list instead
329
+ response . png_luts = response . png_luts_new
330
+ }
340
331
341
- response . luts . map (
342
- ( l ) => {
343
- let mapValue =
344
- Object . assign ( {
345
- nice_name :
346
- l . name . replace ( / .l u t / g, "" ) . replace ( / _ / g, " " ) ,
347
- index : is_dynamic_lut ? l . png_index_new : l . png_index
348
- } , l ) ;
349
- this . luts . set ( mapValue . name , mapValue ) ;
350
- } ) ;
351
- for ( let [ id , conf ] of this . image_configs ) conf . changed ( ) ;
352
- }
353
- } ) ;
332
+ response . luts . forEach (
333
+ ( l ) => {
334
+ let mapValue =
335
+ Object . assign ( {
336
+ nice_name :
337
+ l . name . replace ( / .l u t / g, "" ) . replace ( / _ / g, " " ) ,
338
+ index : is_dynamic_lut ? l . png_index_new : l . png_index
339
+ } , l ) ;
340
+ this . luts . set ( mapValue . name , mapValue ) ;
341
+ } ) ;
342
+ for ( let [ id , conf ] of this . image_configs ) conf . changed ( ) ;
354
343
}
355
344
} ) ;
356
345
}
0 commit comments