aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator/static/javascripts
diff options
context:
space:
mode:
authorAlvin Li <liweitianux@gmail.com>2013-10-04 23:56:35 +0800
committerAlvin Li <liweitianux@gmail.com>2013-10-04 23:56:35 +0800
commitf552b41f4b337e6844f71c29ff177915abbfa417 (patch)
tree7ade59430c6767a5b379c7a8cb95af3387622b13 /97suifangqa/apps/indicator/static/javascripts
parent816730ff659e1338ab3e37a1d45ea337e337b3dd (diff)
download97dev-f552b41f4b337e6844f71c29ff177915abbfa417.tar.bz2
* indicator/static/javascripts/card_chart.js:
improved the display position of 'detail_card_info' * indicator/templates/indicator/SheetDefault.html: destroy 'qtip' when close card * added new app 'apps/sfaccount' * implemented 'signup' and 'activate' functions * implemented async sending activation mail (using 'django-celery' and 'redis') * moved 'registration/*' templates to 'sfaccount/templates' * implemented 'password_change' function: o password_change o password_change_done * implemented 'password_reset' function o password_reset o password_reset_done o password_reset_confirm o password_reset_complete o re-write 'sfaccount.fomrs.SFPasswordResetForm' o re-write 'sfaccount.views.password_reset_view' * improved 'sfaccount.functional' send mail functions o to send 'multipart' mail * added 'README.txt' * added app 'apps/recommend': for comparing with the SCI papers and then recommending most related papers for user.
Diffstat (limited to '97suifangqa/apps/indicator/static/javascripts')
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/card_chart.js20
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js60
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: //