aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js
blob: da5c896f1047e35594f5cb5379088cf61fdc432c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// global js var: card_2_delete_id (type: string)

$(document).ready(function(){
    // console.log(parent.card_2_delete_id); //要取消关注的 卡片id 的获取方法
    //点大叉、继续关注按钮,关闭弹层页面
    $(".delete_card_tip_close, .action_confirm_ignore").bind("click", function(){
        parent.TB_remove();
        return false;
    });

    //取消关注,关闭弹层页面
    $(".action_confirm_cancel").bind("click", function(){
        // ajax process to unfollow the indicator
        // indicator_id -> parseInt(parent.card_2_delete_id)
        // 底层数据层取消关注(ajax)
        var date = new Date();
        var time = date.getTime();
        $.ajax({
            type: 'get',
            url: parent.indicator_url + 'ajax/unfollow_indicator',
            data: 'indicator_id='+parent.card_2_delete_id+'&time='+time,
            success: function(data) {
                if (data == 'success') {
                    // destroy the 'qtip' if exist
                    //$('#index_card_'+parent.card_2_delete_id, window.parent.document).qtip('destroy', true);
                    // remove card
                    parent.delete_card();
                    parent.TB_remove();
                }
            },
        });

        return false;
    });
});
// vim: set ts=4 sw=4 tw=0 fenc=utf-8 ft=javascript: //