summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashantsinalkar2017-02-02 17:39:17 +0530
committerprashantsinalkar2019-09-01 22:13:10 +0530
commit0f227125f2c6d996d1528048d00f3e9a23e08df0 (patch)
treed2d46a8d100dcaa1cc089b0946bcfd5e5e748ed9
parent8ffe399aa099cb67bed1611873cf655693f00521 (diff)
downloadr_tbc_fixer-0f227125f2c6d996d1528048d00f3e9a23e08df0.tar.gz
r_tbc_fixer-0f227125f2c6d996d1528048d00f3e9a23e08df0.tar.bz2
r_tbc_fixer-0f227125f2c6d996d1528048d00f3e9a23e08df0.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(),
);