diff options
Diffstat (limited to '97suifangqa/apps/indicator/static/javascripts')
-rw-r--r-- | 97suifangqa/apps/indicator/static/javascripts/card_chart.js | 20 | ||||
-rw-r--r-- | 97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js | 60 |
2 files changed, 50 insertions, 30 deletions
diff --git a/97suifangqa/apps/indicator/static/javascripts/card_chart.js b/97suifangqa/apps/indicator/static/javascripts/card_chart.js index 92a91c0..ef2eb24 100644 --- a/97suifangqa/apps/indicator/static/javascripts/card_chart.js +++ b/97suifangqa/apps/indicator/static/javascripts/card_chart.js @@ -92,6 +92,22 @@ $(document).ready(function(){ // update 'detail_card_id' detail_card_id = $(this).closest(".index_card").attr("id").replace('index_card_', ''); var card = $("#index_card_"+detail_card_id); + // determine the position to show the 'detail_card' + var pos_to_insertafter = null; + if (card.hasClass("index_card_sec")) { + // this card in on the right + pos_to_insertafter = card; + } + else if (card.nextAll(".index_card_sec").length) { + // this card is on the left + pos_to_insertafter = card.nextAll(".index_card_sec").first(); + } + else { + // this card is the last card + pos_to_insertafter = card.nextAll(".act_card_container"); + } + // move 'detail_card_info' div + $(".detail_card_info").insertAfter(pos_to_insertafter); // check if this card has data (class "record_empty") if (card.hasClass("record_empty")) { $(".detail_card_info").hide(); @@ -142,7 +158,7 @@ $(document).ready(function(){ getdata_type, getdata_num, begin_date_str, end_date_str ); - $(".act_card_container").addClass("move_div_2_left"); + //$(".act_card_container").addClass("move_div_2_left"); return false; }); @@ -215,7 +231,7 @@ $(document).ready(function(){ //初始化详细卡片id detail_card_id = "-1"; //添加删除div位置初始化 - $(".act_card_container").removeClass("move_div_2_left"); + //$(".act_card_container").removeClass("move_div_2_left"); return false; }); }); diff --git a/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js b/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js index 9365d46..da5c896 100644 --- a/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js +++ b/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js @@ -1,32 +1,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') { - parent.delete_card(); - parent.TB_remove(); - } - }, - }); - - return false; - }); + // 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: // |