@@ -50,7 +50,10 @@ const AntaresForms = {
50
50
self . elements . disabledDashboardChartCompareMode ( ) ;
51
51
self . elements . stopScroll ( ) ;
52
52
self . elements . updateHeightChartJS ( ) ;
53
- self . elements . logsCorrectTimelineBorder ( ) ;
53
+ self . elements . cardChartHeaderTruncate ( ) ;
54
+ self . elements . checkIfNeedTruncateTooltip ( ) ;
55
+ self . elements . classForChart ( ) ;
56
+
54
57
//MDL reinit
55
58
componentHandler . upgradeAllRegistered ( ) ;
56
59
} ,
@@ -502,9 +505,9 @@ const AntaresForms = {
502
505
503
506
// Select2 Init - Mdl Big
504
507
$ ( '[data-selectAR--mdl-big]' ) . each ( function ( ) {
505
- if ( $ ( this ) . data ( 'select2' ) ) {
506
- return false ;
507
- }
508
+ // if ($(this).data('select2')) {
509
+ // return false;
510
+ // }
508
511
let myData = $ ( this ) . attr ( 'data-select2--class' ) ;
509
512
if ( myData === undefined ) {
510
513
myData = '' ;
@@ -1184,6 +1187,7 @@ const AntaresForms = {
1184
1187
enquire . register ( 'screen and (min-width: 1450px)' , {
1185
1188
match : function ( ) {
1186
1189
updateHeight ( 'desc' ) ;
1190
+
1187
1191
function updateHeightCharts ( containerTarget ) {
1188
1192
if ( containerTarget === undefined ) {
1189
1193
return false ;
@@ -1213,6 +1217,7 @@ const AntaresForms = {
1213
1217
cardChartHeaderTruncate ( ) {
1214
1218
$ ( '.card--chart .card__header' ) . each ( function ( ) {
1215
1219
let self = $ ( this ) ;
1220
+
1216
1221
function giveTruncate ( ) {
1217
1222
let widthHeader = self . width ( ) ;
1218
1223
let thisNameSpan = self . find ( '.card__header-left span' ) ;
@@ -1265,6 +1270,7 @@ const AntaresForms = {
1265
1270
thisNameSpan . qtip ( 'destroy' ) ;
1266
1271
}
1267
1272
}
1273
+
1268
1274
$ ( window ) . resize (
1269
1275
_ . debounce ( function ( ) {
1270
1276
giveTruncate ( ) ;
@@ -1275,19 +1281,80 @@ const AntaresForms = {
1275
1281
} ) ;
1276
1282
} ) ;
1277
1283
} ,
1278
- checkIfNeedTruncateTooltip ( ) {
1279
- $ ( '.check-truncate-tooltip' ) . each ( function ( ) {
1280
- let $self = $ ( this )
1281
- let thisSelfWidth = $self . width ( )
1282
- let grandFatherWidth = $self . parent ( ) . parent ( ) . width ( )
1283
- let positionLeft = $self . position ( ) . left
1284
- if ( thisSelfWidth > grandFatherWidth && ( positionLeft > 10 || grandFatherWidth - positionLeft > 10 ) ) {
1285
- let maxWidthForSelf = grandFatherWidth - positionLeft - 20
1286
- $self . attr ( 'data-tooltip-inline' , $self . text ( ) )
1287
- $self . css ( 'overflow' , 'hidden' ) . css ( 'white-space' , 'nowrap' ) . css ( 'text-overflow' , 'ellipsis' ) . css ( 'max-width' , maxWidthForSelf )
1288
- }
1289
- } )
1290
- }
1284
+ checkIfNeedTruncateTooltip ( ) {
1285
+ $ ( '.check-truncate-tooltip' ) . each ( function ( ) {
1286
+ let $self = $ ( this ) ;
1287
+ let thisSelfWidth = $self . width ( ) ;
1288
+ let grandFatherWidth = $self
1289
+ . parent ( )
1290
+ . parent ( )
1291
+ . width ( ) ;
1292
+ let positionLeft = $self . position ( ) . left ;
1293
+ if ( thisSelfWidth > grandFatherWidth && ( positionLeft > 10 || grandFatherWidth - positionLeft > 10 ) ) {
1294
+ let maxWidthForSelf = grandFatherWidth - positionLeft - 20 ;
1295
+ $self . attr ( 'data-tooltip-inline' , $self . text ( ) ) ;
1296
+ $self
1297
+ . css ( 'overflow' , 'hidden' )
1298
+ . css ( 'white-space' , 'nowrap' )
1299
+ . css ( 'text-overflow' , 'ellipsis' )
1300
+ . css ( 'max-width' , maxWidthForSelf ) ;
1301
+ }
1302
+ } ) ;
1303
+ } ,
1304
+ classForChart ( ) {
1305
+ enquire . register ( 'screen and (max-width: 767px)' , {
1306
+ match : function ( ) {
1307
+ $ ( '.card--chart' )
1308
+ . closest ( '.card-container' )
1309
+ . removeClass ( 'chart--mobile chart--tablet chart--laptop chart--desktop' )
1310
+ . addClass ( 'chart--mobile' ) ;
1311
+ } ,
1312
+ unmatch : function ( ) {
1313
+ $ ( '.card--chart' )
1314
+ . closest ( '.card-container' )
1315
+ . removeClass ( 'chart--mobile' ) ;
1316
+ }
1317
+ } ) ;
1318
+ enquire . register ( 'screen and (min-width: 768px) and (max-width:1023px)' , {
1319
+ match : function ( ) {
1320
+ $ ( '.card--chart' )
1321
+ . closest ( '.card-container' )
1322
+ . removeClass ( 'chart--mobile chart--tablet chart--laptop chart--desktop' )
1323
+ . addClass ( 'chart--tablet' ) ;
1324
+ } ,
1325
+ unmatch : function ( ) {
1326
+ $ ( '.card--chart' )
1327
+ . closest ( '.card-container' )
1328
+ . removeClass ( 'chart--tablet' ) ;
1329
+ }
1330
+ } ) ;
1331
+ enquire . register ( 'screen and (min-width:1024px) and (max-width:1366px)' , {
1332
+ match : function ( ) {
1333
+ $ ( '.card--chart' )
1334
+ . closest ( '.card-container' )
1335
+ . removeClass ( 'chart--mobile chart--tablet chart--laptop chart--desktop' )
1336
+ . addClass ( 'chart--laptop' ) ;
1337
+ } ,
1338
+ unmatch : function ( ) {
1339
+ $ ( '.card--chart' )
1340
+ . closest ( '.card-container' )
1341
+ . removeClass ( 'chart--laptop' ) ;
1342
+ }
1343
+ } ) ;
1344
+ enquire . register ( 'screen and (min-width:1367px)' , {
1345
+ match : function ( ) {
1346
+ $ ( '.card--chart' )
1347
+ . closest ( '.card-container' )
1348
+ . removeClass ( 'chart--mobile chart--tablet chart--laptop chart--desktop' )
1349
+ . addClass ( 'chart--desktop' ) ;
1350
+ } ,
1351
+ unmatch : function ( ) {
1352
+ $ ( '.card--chart' )
1353
+ . closest ( '.card-container' )
1354
+ . removeClass ( 'chart--desktop' ) ;
1355
+ }
1356
+ } ) ;
1357
+ }
1291
1358
}
1292
1359
} ;
1293
1360
0 commit comments