summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashantsinalkar2017-02-02 17:39:17 +0530
committerprashantsinalkar2017-02-02 17:39:17 +0530
commit9bb4d56b6bd962b453692ceb83274eba8d516e6d (patch)
tree733c112daa4e402b8362418e4c44882db7765598
parent02c5b4d8bcbfaf76153c131aa4f3410f2ca092d0 (diff)
downloadtextbook_companion_fixer-9bb4d56b6bd962b453692ceb83274eba8d516e6d.tar.gz
textbook_companion_fixer-9bb4d56b6bd962b453692ceb83274eba8d516e6d.tar.bz2
textbook_companion_fixer-9bb4d56b6bd962b453692ceb83274eba8d516e6d.zip
added some minor changes
-rw-r--r--js/textbook_companion_fixer_edit_category.js14
-rw-r--r--textbook_companion_fixer_edit_book_category.inc3
2 files changed, 14 insertions, 3 deletions
diff --git a/js/textbook_companion_fixer_edit_category.js b/js/textbook_companion_fixer_edit_category.js
index 2821382..f10973b 100644
--- a/js/textbook_companion_fixer_edit_category.js
+++ b/js/textbook_companion_fixer_edit_category.js
@@ -74,20 +74,28 @@
$("input[name='ids[]']:checked").each(function (){
main_cat_chk_value.push(parseInt($(this).val()));
});
- console.log(modPath);
+ var sub_cat_select_value = $.map($('select[name="subcats"] :selected'), function (val, _) {
+ var newObj = {};
+ if(val.value > '0'){
+ newObj.subcats = val.value;
+ }
+ return newObj;
+ });
+ var pref_id = $('.prefrence_id').val();
+ console.log(pref_id);
$.ajax({
url: modPath,
type: "POST",
data: {
pref_id: pref_id,
main_category: main_cat_chk_value,
- subcategory: ""
+ sub_category: sub_cat_select_value
},
dataType: "html",
success: function(data) {
$updating.hide();
$done.show();
- console.log("data: +" + main_cat_chk_value);
+ console.log("data1: " + main_cat_chk_value + " data2: "+ sub_cat_select_value);
$done.fadeOut("slow");
//alert("ok");
}
diff --git a/textbook_companion_fixer_edit_book_category.inc b/textbook_companion_fixer_edit_book_category.inc
index 56429cc..d7b640b 100644
--- a/textbook_companion_fixer_edit_book_category.inc
+++ b/textbook_companion_fixer_edit_book_category.inc
@@ -99,6 +99,9 @@ function textbook_companion_fixer_category_edit_form($form, &$form_state)
'#title' => t('Year of pulication'),
'#markup' => $preference_data->year
);
+ $form["wrapper"]['pref_id'] = array(
+ '#markup' => '<input class="prefrence_id" type="hidden" name="pref_id" value="'.$preference_data->id.'">'
+ );
$form["wrapper"]['main_category']= array(
"#markup" => _textbook_companion_fixer_list_of_category_checkboxes(),
);