From c9da4168874296cf4f5ba71b9a432ceae3c26130 Mon Sep 17 00:00:00 2001 From: Alvin Li Date: Fri, 20 Sep 2013 23:52:59 +0800 Subject: *** merged changes of front pages *** * merged changes from '97suifang-front' by mjymjydark; and modified to work with django * finished 'editing_data' div of 'SheetDefault' for add new record * added 'indicator.views.ajax_add_record()' *** search *** * improved 'search' function of 'NewDeleteIndex' page; employ AJAX to load search results; * added 'indicator.views.search_indicators()' *** recommend indicator *** * improved the functions of 'recommend_indicator' * added 'sciblog.models.UserCollection' to record the collection information for each user * improved 'sciblog.views.add_user_to_m2m()' to work with 'UserCollection' * added field 'lastRecommendTime' in 'indicator.models.UserIndicator' * updated 'indicator.views.indicator_status' against 'recommend_indicator' *** qtip2 for recommended indicator *** * added 'qtip2' tooltip for recommended indicator card * added '97suifang' qtip css (qtip-sf) * added tooltip for 'add record' when return error (SheetDefault page); * improved the style of 'collection_btn' and 'go_library_btn' of IndexDesc page; --- 97suifangqa/apps/indicator/static/javascripts/card_chart.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to '97suifangqa/apps/indicator/static/javascripts/card_chart.js') diff --git a/97suifangqa/apps/indicator/static/javascripts/card_chart.js b/97suifangqa/apps/indicator/static/javascripts/card_chart.js index 8398345..75cbf78 100644 --- a/97suifangqa/apps/indicator/static/javascripts/card_chart.js +++ b/97suifangqa/apps/indicator/static/javascripts/card_chart.js @@ -91,14 +91,14 @@ $(document).ready(function(){ $(".detail_history").bind("click", function(){ // update 'detail_card_id' detail_card_id = $(this).closest(".index_card").attr("id").replace('index_card_', ''); - // check if this card has data - // if has no data, then exists div class="edit_icon_container" - if ($("#index_card_"+detail_card_id + " .edit_icon_container").length) { + var card = $("#index_card_"+detail_card_id); + // check if this card has data (class "record_empty") + if (card.hasClass("record_empty")) { $(".detail_card_info").hide(); return false; } // get the index title and set for the 'detail card' - var index_title = $("#index_card_"+detail_card_id + " .card_title").html(); + var index_title = card.find(".card_title").html(); $(".detail_card_info .card_title .title").html(index_title); // set date for the 'shift_date' buttons var date_fmt = 'YYYY-MM-DD'; @@ -116,6 +116,9 @@ $(document).ready(function(){ // options for chart global var: 'options_chart_' // update global var 'detail_chart_options_str' detail_chart_options_str = 'options_chart_' + detail_card_id; + if (typeof window[detail_chart_options_str] === 'undefined') { + return false; + } // clickable data point window[detail_chart_options_str].plotOptions = { series: { -- cgit v1.2.2