summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashantsinalkar2017-01-28 21:38:46 +0530
committerprashantsinalkar2019-09-01 22:13:09 +0530
commit40561078713460ec77b2e7fe260edf86d089e0fc (patch)
tree0aff44f11bd07de6b3a3ea24a4603285e87c5639
parent5a104c26ade296722589f61b01ed45fd376b82d3 (diff)
downloadr_tbc_fixer-40561078713460ec77b2e7fe260edf86d089e0fc.tar.gz
r_tbc_fixer-40561078713460ec77b2e7fe260edf86d089e0fc.tar.bz2
r_tbc_fixer-40561078713460ec77b2e7fe260edf86d089e0fc.zip
added js for edit category
-rw-r--r--js/textbook_companion_fixer_edit_category.js84
1 files changed, 84 insertions, 0 deletions
diff --git a/js/textbook_companion_fixer_edit_category.js b/js/textbook_companion_fixer_edit_category.js
new file mode 100644
index 0000000..9c2c4f7
--- /dev/null
+++ b/js/textbook_companion_fixer_edit_category.js
@@ -0,0 +1,84 @@
+(function($) {
+ $(document).ready(function() {
+ var basePath = Drupal.settings.basePath;
+ var modPath = basePath + "textbook_companion_fixer/ajax/edit-book-category/";
+ $category_form = $("#fix-tbc-category-form");
+ $main_category1 = $(".main-category-1");
+ $main_category2 = $(".main-category-2");
+ $main_category3 = $(".main-category-3");
+ $main_category4 = $(".main-category-4");
+ $main_category5 = $(".main-category-5");
+ $main_category6 = $(".main-category-6");
+ $main_category7 = $(".main-category-7");
+ $(".main-subcategory-1").hide();
+ $(".main-subcategory-2").hide();
+ $(".main-subcategory-3").hide();
+ $(".main-subcategory-4").hide();
+ $(".main-subcategory-5").hide();
+ $(".main-subcategory-6").hide();
+ $(".main-subcategory-7").hide();
+ prop = $('.main-category-chk-1').prop('checked');
+ console.log(prop);
+ $('.main-category-chk-1').change(function() {
+ if (!this.checked) {
+ $('.main-subcategory-1').hide();
+ $('.main-subcategory-1').prop('selectedIndex', 0);
+ } else {
+ $('.main-subcategory-1').show();
+ }
+ });
+ $('.main-category-chk-2').change(function() {
+ if (!this.checked) {
+ $('.main-subcategory-2').hide();
+ $('.main-subcategory-2').prop('selectedIndex', 0);
+ } else {
+ $('.main-subcategory-2').show();
+ }
+ });
+ $('.main-category-chk-3').change(function() {
+ if (!this.checked) {
+ $('.main-subcategory-3').hide();
+ $('.main-subcategory-3').prop('selectedIndex', 0);
+ } else {
+ $('.main-subcategory-3').show();
+ }
+ });
+ $('.main-category-chk-4').change(function() {
+ if (!this.checked) {
+ $('.main-subcategory-4').hide();
+ $('.main-subcategory-4').prop('selectedIndex', 0);
+ } else {
+ $('.main-subcategory-4').show();
+ }
+ });
+ $('.main-category-chk-5').change(function() {
+ if (!this.checked) {
+ $('.main-subcategory-5').hide();
+ $('.main-subcategory-5').prop('selectedIndex', 0);
+ } else {
+ $('.main-subcategory-5').show();
+ }
+ });
+ $('.main-category-chk-6').change(function() {
+ if (!this.checked) {
+ $('.main-subcategory-6').hide();
+ $('.main-subcategory-6').prop('selectedIndex', 0);
+ } else {
+ $('.main-subcategory-6').show();
+ }
+ });
+ $('.main-category-chk-7').change(function() {
+ if (!this.checked) {
+ $('.main-subcategory-7').hide();
+ $('.main-subcategory-7').prop('selectedIndex', 0);
+ } else {
+ $('.main-subcategory-7').show();
+ }
+ });
+ //edit category form submit
+ $category_form.submit(function(e) {
+ e.preventDefault();
+ });
+
+ });
+})(jQuery);