@@ -349,6 +349,51 @@ function refreshUpdateNumber() {
349
349
}
350
350
}
351
351
} ) ;
352
+ if ( $ ( '#spanNbUpdates' ) . length ) {
353
+ nextdom . update . numbers ( {
354
+ error : function ( error ) {
355
+ notify ( "Erreur" , error . message , 'error' ) ;
356
+ } ,
357
+ success : function ( _numbers ) {
358
+ if ( _numbers . all == 0 || _numbers . all == '0' ) {
359
+ $ ( '#spanNbUpdates' ) . hide ( ) ;
360
+ } else {
361
+ $ ( '#spanNbUpdates' ) . html ( _numbers . all ) ;
362
+ $ ( '#spanNbUpdates' ) . show ( ) ;
363
+ }
364
+ if ( _numbers . core == 0 || _numbers . core == '0' ) {
365
+ $ ( '#spanNbUpdatesCore' ) . hide ( ) ;
366
+ } else {
367
+ $ ( '#spanNbUpdatesCore' ) . html ( _numbers . core ) ;
368
+ $ ( '#spanNbUpdatesCore' ) . show ( ) ;
369
+ }
370
+ if ( _numbers . plugin == 0 || _numbers . plugin == '0' ) {
371
+ $ ( '#spanNbUpdatesPlugins' ) . hide ( ) ;
372
+ } else {
373
+ $ ( '#spanNbUpdatesPlugins' ) . html ( _numbers . plugin ) ;
374
+ $ ( '#spanNbUpdatesPlugins' ) . show ( ) ;
375
+ }
376
+ if ( _numbers . widget == 0 || _numbers . widget == '0' ) {
377
+ $ ( '#spanNbUpdatesWidgets' ) . hide ( ) ;
378
+ } else {
379
+ $ ( '#spanNbUpdatesWidgets' ) . html ( _numbers . widget ) ;
380
+ $ ( '#spanNbUpdatesWidgets' ) . show ( ) ;
381
+ }
382
+ if ( _numbers . script == 0 || _numbers . script == '0' ) {
383
+ $ ( '#spanNbUpdatesScripts' ) . hide ( ) ;
384
+ } else {
385
+ $ ( '#spanNbUpdatesScripts' ) . html ( _numbers . script ) ;
386
+ $ ( '#spanNbUpdatesScripts' ) . show ( ) ;
387
+ }
388
+ if ( _numbers . others == 0 || _numbers . others == '0' ) {
389
+ $ ( '#spanNbUpdatesOthers' ) . hide ( ) ;
390
+ } else {
391
+ $ ( '#spanNbUpdatesOthers' ) . html ( _numbers . others ) ;
392
+ $ ( '#spanNbUpdatesOthers' ) . show ( ) ;
393
+ }
394
+ }
395
+ } ) ;
396
+ }
352
397
}
353
398
354
399
/**
@@ -406,18 +451,29 @@ function displayClock() {
406
451
* Adjust size and position of jquery modales
407
452
*/
408
453
function modalesAdjust ( ) {
409
- var modals = [ $ ( '#md_modal' ) , $ ( '#md_modal2' ) ] ;
454
+ var modals = [ $ ( '#md_modal' ) , $ ( '#md_modal2' ) , $ ( '#md_pageHelp' ) ] ;
410
455
modals . forEach ( function ( modal ) {
411
456
if ( modal . is ( ':ui-dialog' ) ) {
412
457
modal . dialog ( 'option' , 'width' , getModalWidth ( ) ) ;
458
+ modal . dialog ( 'option' , 'height' , getModalHeight ( ) ) ;
413
459
modal . dialog ( 'option' , 'position' , { my : 'center' , at : 'center' , of : window } ) ;
414
460
}
415
461
} ) ;
416
462
}
417
463
464
+ /**
465
+ * Calcul modal width depend of width screen
466
+ */
418
467
function getModalWidth ( ) {
419
468
if ( jQuery ( window ) . width ( ) < 1000 ) {
420
469
return '96%' ;
421
470
}
422
471
return '80%' ;
423
472
}
473
+
474
+ /**
475
+ * Calcul modal width depend of width screen
476
+ */
477
+ function getModalHeight ( ) {
478
+ return ( jQuery ( window ) . height ( ) - 100 ) ;
479
+ }
0 commit comments