Subversion Repositories SmartDukaan

Rev

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

Rev 36836 Rev 37498
Line 309... Line 309...
309
                }
309
                }
310
            });
310
            });
311
        }
311
        }
312
    })();
312
    })();
313
 
313
 
-
 
314
    // Fragment is re-injected with .html(), which re-runs this script; clear the
-
 
315
    // namespace first so handlers replace rather than stack.
-
 
316
    $(document).off('.beatreportuserdetail');
314
    $(document).on('click', '.read-more-link', function () {
317
    $(document).on('click.beatreportuserdetail', '.read-more-link', function () {
315
        $(this).closest('td').find('.desc-short').hide();
318
        $(this).closest('td').find('.desc-short').hide();
316
        $(this).closest('td').find('.desc-full').show();
319
        $(this).closest('td').find('.desc-full').show();
317
    });
320
    });
318
    $(document).on('click', '.read-less-link', function () {
321
    $(document).on('click.beatreportuserdetail', '.read-less-link', function () {
319
        $(this).closest('td').find('.desc-full').hide();
322
        $(this).closest('td').find('.desc-full').hide();
320
        $(this).closest('td').find('.desc-short').show();
323
        $(this).closest('td').find('.desc-short').show();
321
    });
324
    });
322
 
325
 
323
    $(document).off('click.beatdetail').off('click.livetrack');
326
    $(document).off('click.beatdetail').off('click.livetrack');
Line 802... Line 805...
802
            $('#liveTrackingInfo').html('<div class="text-center"><i class="fa fa-spinner fa-spin"></i> Refreshing...</div>');
805
            $('#liveTrackingInfo').html('<div class="text-center"><i class="fa fa-spinner fa-spin"></i> Refreshing...</div>');
803
            loadLiveTracking(liveTrackingUserId, liveTrackingUsername);
806
            loadLiveTracking(liveTrackingUserId, liveTrackingUsername);
804
        }
807
        }
805
    });
808
    });
806
 
809
 
807
    $(document).on('change', '#autoRefreshToggle', function () {
810
    $(document).on('change.beatreportuserdetail', '#autoRefreshToggle', function () {
808
        if ($(this).is(':checked')) {
811
        if ($(this).is(':checked')) {
809
            startAutoRefresh();
812
            startAutoRefresh();
810
        } else {
813
        } else {
811
            stopAutoRefresh();
814
            stopAutoRefresh();
812
        }
815
        }
Line 816... Line 819...
816
        stopAutoRefresh();
819
        stopAutoRefresh();
817
        liveTrackingUserId = null;
820
        liveTrackingUserId = null;
818
    });
821
    });
819
 
822
 
820
    // Attachment Viewer
823
    // Attachment Viewer
821
    $(document).on('click', '.view-attachment-link', function () {
824
    $(document).on('click.beatreportuserdetail', '.view-attachment-link', function () {
822
        var attachment = $(this).data('attachment');
825
        var attachment = $(this).data('attachment');
823
        var checkinLatLng = $(this).data('checkin-latlng') || '';
826
        var checkinLatLng = $(this).data('checkin-latlng') || '';
824
        var visitLocation = $(this).data('visit-location') || '';
827
        var visitLocation = $(this).data('visit-location') || '';
825
        var trackingId = $(this).data('tracking-id');
828
        var trackingId = $(this).data('tracking-id');
826
 
829
 
Line 856... Line 859...
856
        }
859
        }
857
 
860
 
858
        $('#attachmentViewerModal').modal('show');
861
        $('#attachmentViewerModal').modal('show');
859
    });
862
    });
860
 
863
 
861
    $(document).on('click', '#approveCheckinBtn', function () {
864
    $(document).on('click.beatreportuserdetail', '#approveCheckinBtn', function () {
862
        var btn = $(this);
865
        var btn = $(this);
863
        var trackingId = btn.data('tracking-id');
866
        var trackingId = btn.data('tracking-id');
864
        if (!trackingId) return;
867
        if (!trackingId) return;
865
 
868
 
866
        btn.prop('disabled', true).html('<i class="fa fa-spinner fa-spin"></i> Approving...');
869
        btn.prop('disabled', true).html('<i class="fa fa-spinner fa-spin"></i> Approving...');