aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator/static/javascripts
diff options
context:
space:
mode:
authorAlvin Li <liweitianux@gmail.com>2013-10-30 10:16:21 +0800
committerAlvin Li <liweitianux@gmail.com>2013-10-30 10:16:21 +0800
commit1e4a9c0565c3d2f52ec205ae7627ebfc84278735 (patch)
treeb26921e2f5fdec3fa7578584d10ba476abbace40 /97suifangqa/apps/indicator/static/javascripts
parent02afd8a32edb13ea7fc2266ac80092ea15c0930c (diff)
download97dev-1e4a9c0565c3d2f52ec205ae7627ebfc84278735.tar.bz2
* merged commits from 'maxwell lou' by time '20131028_09:52';HEADmaster
* moved 'ValueKind' model from 'recommend/models' to 'indicator/models' * added field 'type' for 'indicator.models.Indicator' * added field 'kind' for 'indicator.models.IndicatorRecord', 'InnateConfine' * updated methods for models 'Indicator', 'IndicatorRecord', 'InnateConfine' * updated views and templates for 'apps/indicator' * added 'INDICATOR_RECOMMEND_PERIOD' into 'settings.py' * added 'type' field for 'indicator.models.Indicator' in 'search_indexes.py' * added a confirm step for 'EditHistoryData' page when delete a record * removed dir 'backupdata'; 'queries.txt' moved to 'backup' dir * moved *.json to 'backup' dir * removed 'apps/managers*.py' * updated 'indicator/popup/IndexDesc.html' * created dir 'apps/indicator/obsolete'; * moved 'indicator/forms.py' to dir 'obsolete'; * splitted views related forms.py from 'views.py', and placed in 'obsolete/views_forms.py' * loadded newest data into database * cleaned pervious data files in 'backup' dir * updated 'README.txt'; added a solution to a redis problem * added field 'type' of 'indicator.models.Indicator'; for filtering search results and only returning 'NORMAL_TYPE'
Diffstat (limited to '97suifangqa/apps/indicator/static/javascripts')
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/edit_history_data.js18
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/new_delete_index.js15
2 files changed, 30 insertions, 3 deletions
diff --git a/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js b/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js
index d4ccdf5..898e904 100644
--- a/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js
+++ b/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js
@@ -21,8 +21,21 @@ $(document).ready(function(){
maxDate: 0 // 0->today, 1->tomorrow
});
+ // delete record {{{
// delete button
$("#delete_btn").bind("click", function(){
+ var this_edit_data_div = $(this).closest(".edit_data");
+ var this_delete_prompt_div = this_edit_data_div.siblings(".delete_prompt");
+ this_delete_prompt_div.show();
+ return false;
+ });
+ // cancel delete button
+ $("#cancel_delete_btn").bind("click", function(){
+ $(this).closest(".delete_prompt").hide();
+ return false;
+ });
+ // confirm delete button
+ $("#confirm_delete_btn").bind("click", function(){
// delete record (ajax)
var time = moment().valueOf();
$.ajax({
@@ -51,13 +64,16 @@ $(document).ready(function(){
});
return false;
});
+ // }}}
// edit button
$("#edit_btn").bind("click", function(){
var this_edit_data_div = $(this).closest(".edit_data");
var this_editing_data_div = this_edit_data_div.siblings(".editing_data");
- this_editing_data_div.show();
+ var this_delete_prompt_div = this_edit_data_div.siblings(".delete_prompt");
+ this_delete_prompt_div.hide();
this_edit_data_div.hide();
+ this_editing_data_div.show();
return false;
});
diff --git a/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js b/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js
index e216f09..635e9c7 100644
--- a/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js
+++ b/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js
@@ -22,6 +22,16 @@ $(document).ready(function(){
}
);
+ // 'all_condition' letter selectors {{{
+ // disable all letter selectors
+ $(".index_all_letter .letter").addClass("disabled");
+ $(".index_letter_container .letter_section").each(function() {
+ var l = $(this).attr('id').replace('sec_', '');
+ //console.log(l);
+ $(".index_all_letter #"+l).removeClass("disabled");
+ });
+ // }}}
+
// login control kit {{{
$(".drop-down-area").bind("click", function(){
var drop_down_menu = $(".drop-down-menu");
@@ -144,8 +154,9 @@ $(document).ready(function(){
$(".letter_selected").removeClass("letter_selected");
$(this).addClass("letter_selected");
var container = $(".index_letter_container");
- var letterClass = $(this).text();
- var scrollTo = $("."+letterClass);
+ var letterClass = $(this).attr('id');
+ //console.log(letterClass);
+ var scrollTo = $("#sec_"+letterClass);
container.scrollTop(scrollTo.offset().top - container.offset().top + container.scrollTop());
select_letter = letterClass;
return false;