diff options
author | Alvin Li <liweitianux@gmail.com> | 2013-09-20 23:52:59 +0800 |
---|---|---|
committer | Alvin Li <liweitianux@gmail.com> | 2013-09-20 23:52:59 +0800 |
commit | c9da4168874296cf4f5ba71b9a432ceae3c26130 (patch) | |
tree | 0c986d630c9634b8dbbbbe694546b42c7bb74210 /97suifangqa/apps/indicator/static/javascripts/card_chart.js | |
parent | 62efe8809e2cdfc84666dbd5e987a4ce473a047a (diff) | |
download | 97dev-c9da4168874296cf4f5ba71b9a432ceae3c26130.tar.bz2 |
*** 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;
Diffstat (limited to '97suifangqa/apps/indicator/static/javascripts/card_chart.js')
-rw-r--r-- | 97suifangqa/apps/indicator/static/javascripts/card_chart.js | 11 |
1 files changed, 7 insertions, 4 deletions
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_<id>' // 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: { |