Subversion Repositories SmartDukaan

Rev

Rev 33649 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33649 Rev 35971
Line 59... Line 59...
59
    }
59
    }
60
 
60
 
61
    .DTFC_LeftBodyLiner {
61
    .DTFC_LeftBodyLiner {
62
        overflow: hidden !important;
62
        overflow: hidden !important;
63
    }
63
    }
-
 
64
 
-
 
65
    /* Modern Tooltip */
-
 
66
    [data-tip] {
-
 
67
        cursor: pointer;
-
 
68
    }
-
 
69
 
-
 
70
    #fs-tooltip {
-
 
71
        position: fixed;
-
 
72
        background: #1e293b;
-
 
73
        color: #fff;
-
 
74
        font-size: 12px;
-
 
75
        font-weight: 500;
-
 
76
        padding: 6px 12px;
-
 
77
        border-radius: 6px;
-
 
78
        white-space: nowrap;
-
 
79
        z-index: 99999;
-
 
80
        pointer-events: none;
-
 
81
        opacity: 0;
-
 
82
        transition: opacity 0.15s ease;
-
 
83
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
-
 
84
        letter-spacing: 0.3px;
-
 
85
    }
-
 
86
 
-
 
87
    #fs-tooltip.visible {
-
 
88
        opacity: 1;
-
 
89
    }
-
 
90
 
-
 
91
    /* Arrow pointing down (tooltip above cell) */
-
 
92
    #fs-tooltip.arrow-down::after {
-
 
93
        content: '';
-
 
94
        position: absolute;
-
 
95
        top: 100%;
-
 
96
        left: 50%;
-
 
97
        transform: translateX(-50%);
-
 
98
        border: 5px solid transparent;
-
 
99
        border-top-color: #1e293b;
-
 
100
    }
-
 
101
 
-
 
102
    /* Arrow pointing up (tooltip below cell) */
-
 
103
    #fs-tooltip.arrow-up::after {
-
 
104
        content: '';
-
 
105
        position: absolute;
-
 
106
        bottom: 100%;
-
 
107
        left: 50%;
-
 
108
        transform: translateX(-50%);
-
 
109
        border: 5px solid transparent;
-
 
110
        border-bottom-color: #1e293b;
-
 
111
    }
64
</style>
112
</style>
65
 
113
 
66
<section class="wrapper">
114
<section class="wrapper">
67
    <div class="row">
115
    <div class="row">
68
        <div class="col-lg-12">
116
        <div class="col-lg-12">
Line 167... Line 215...
167
 
215
 
168
</section>
216
</section>
169
 
217
 
170
<script>
218
<script>
171
 
219
 
-
 
220
    // Create tooltip element on body (never clipped by overflow)
-
 
221
    $('body').append('<div id="fs-tooltip"></div>');
-
 
222
    var fsTooltip = $('#fs-tooltip');
-
 
223
 
-
 
224
    // Abbreviation maps
-
 
225
    var abbreviationMap = {
-
 
226
        'MA': 'Mark Applicable',
-
 
227
        'NA': 'Not Applicable',
-
 
228
        'SNA': 'Service Not Applicable',
-
 
229
        'PNI': 'Partner Not Interested',
-
 
230
        'No Code': 'Code Not Available',
-
 
231
        'NO': 'Document Compliance Not Done',
-
 
232
        'INITIATED': 'Service Initiated \u2013 Pending Activation',
-
 
233
        '--': 'Never Worked On This Partner'
-
 
234
    };
-
 
235
 
-
 
236
    var classTooltipMap = {
-
 
237
        'working-green': 'Brand Working Properly',
-
 
238
        'not-working-red': 'Brand Not Working (Partner Side)',
-
 
239
        'not-working': 'Brand Not Started'
-
 
240
    };
-
 
241
 
-
 
242
    function applyTooltips() {
-
 
243
        $('.dataTables_wrapper td').each(function () {
-
 
244
            var el = $(this);
-
 
245
            if (el.attr('data-tip')) return;
-
 
246
            var cellText = el.text().trim();
-
 
247
 
-
 
248
            if (abbreviationMap[cellText]) {
-
 
249
                el.attr('data-tip', abbreviationMap[cellText]);
-
 
250
                return;
-
 
251
            }
-
 
252
 
-
 
253
            for (var cls in classTooltipMap) {
-
 
254
                if (el.hasClass(cls)) {
-
 
255
                    el.attr('data-tip', classTooltipMap[cls]);
-
 
256
                    return;
-
 
257
                }
-
 
258
            }
-
 
259
        });
-
 
260
 
-
 
261
        $('.dataTables_wrapper .service-mark-pni').attr('data-tip', 'Partner Not Interested');
-
 
262
        $('.dataTables_wrapper .service-mark-active').attr('data-tip', 'Mark Applicable');
-
 
263
        $('.dataTables_wrapper .service-mark-not-active').attr('data-tip', 'Not Applicable');
-
 
264
    }
-
 
265
 
-
 
266
    // Show tooltip on hover using event delegation (works for all rows including clones)
-
 
267
    $(document).on('mouseenter', '[data-tip]', function () {
-
 
268
        var tipText = $(this).attr('data-tip');
-
 
269
        if (!tipText) return;
-
 
270
 
-
 
271
        fsTooltip.text(tipText).removeClass('arrow-down arrow-up');
-
 
272
        var rect = this.getBoundingClientRect();
-
 
273
        var tipHeight = fsTooltip.outerHeight();
-
 
274
        var tipWidth = fsTooltip.outerWidth();
-
 
275
        var left = rect.left + (rect.width / 2) - (tipWidth / 2);
-
 
276
 
-
 
277
        // Keep within viewport horizontally
-
 
278
        if (left < 5) left = 5;
-
 
279
        if (left + tipWidth > window.innerWidth - 5) left = window.innerWidth - tipWidth - 5;
-
 
280
 
-
 
281
        // Find the header bottom to detect overlap
-
 
282
        var headerEl = document.querySelector('.dataTables_scrollHead');
-
 
283
        var headerBottom = headerEl ? headerEl.getBoundingClientRect().bottom : 0;
-
 
284
 
-
 
285
        var topPos = rect.top - tipHeight - 8;
-
 
286
 
-
 
287
        if (topPos < headerBottom) {
-
 
288
            // Not enough space above (behind header) — show BELOW the cell
-
 
289
            fsTooltip.css({left: left, top: rect.bottom + 8});
-
 
290
            fsTooltip.addClass('visible arrow-up');
-
 
291
        } else {
-
 
292
            // Normal — show ABOVE the cell
-
 
293
            fsTooltip.css({left: left, top: topPos});
-
 
294
            fsTooltip.addClass('visible arrow-down');
-
 
295
        }
-
 
296
    });
-
 
297
 
-
 
298
    $(document).on('mouseleave', '[data-tip]', function () {
-
 
299
        fsTooltip.removeClass('visible arrow-down arrow-up');
-
 
300
    });
-
 
301
 
172
    var dtable = $('#financePartnerServices').DataTable(
302
    var dtable = $('#financePartnerServices').DataTable(
173
            {
303
            {
174
                "scrollX": true,
304
                "scrollX": true,
175
                "scrollY": "700px",
305
                "scrollY": "700px",
176
                "fixedColumns": {
306
                "fixedColumns": {
177
                    leftColumns: 3
307
                    leftColumns: 3
178
                },
308
                },
-
 
309
                "initComplete": function () {
-
 
310
                    applyTooltips();
-
 
311
                }
179
            });
312
            });
180
 
313
 
-
 
314
    dtable.on('draw.dt', function () {
-
 
315
        setTimeout(applyTooltips, 100);
-
 
316
    });
-
 
317
 
181
 
318
 
182
</script>
319
</script>
183
320