Commit 8acd86b2 authored by Bastien Ho's avatar Bastien Ho :alien:
Browse files

v1.8.4

Showing with 50 additions and 10 deletions
+50 -10
## Changelog
### 1.8.4
- Bump jquery-tabs to 1.0.3
- Smooth scroll position in tabs
### 1.8.3
- Manage ProRata / Apportionment cases
......
......@@ -16,7 +16,7 @@
<url desc="GlotPress Path">sudeducation/cartable</url>
</urls>
<releaseDate>2022-01-04</releaseDate>
<version>1.8.3</version>
<version>1.8.4</version>
<develStage>beta</develStage>
<compatibility>
<ver>5.53</ver>
......
......@@ -12,6 +12,6 @@
"vendor-dir": "cartable/vendor"
},
"require": {
"bastienho/jquery-tabs": "^1.0.2"
"bastienho/jquery-tabs": "^1.0.3"
}
}
......@@ -8,16 +8,16 @@
"packages": [
{
"name": "bastienho/jquery-tabs",
"version": "1.0.2",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/bastienho/jquery-tabs.git",
"reference": "e86625c4754ad5a39aa628d79135ef5d32a5d9dc"
"reference": "7b3698412e9940201fb8c7c3a490215a6be62d08"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bastienho/jquery-tabs/zipball/e86625c4754ad5a39aa628d79135ef5d32a5d9dc",
"reference": "e86625c4754ad5a39aa628d79135ef5d32a5d9dc",
"url": "https://api.github.com/repos/bastienho/jquery-tabs/zipball/7b3698412e9940201fb8c7c3a490215a6be62d08",
"reference": "7b3698412e9940201fb8c7c3a490215a6be62d08",
"shasum": ""
},
"type": "jquery-plugin",
......@@ -34,9 +34,9 @@
"description": "Simply add tabs.",
"support": {
"issues": "https://github.com/bastienho/jquery-tabs/issues",
"source": "https://github.com/bastienho/jquery-tabs/tree/1.02"
"source": "https://github.com/bastienho/jquery-tabs/tree/1.0.3"
},
"time": "2022-05-11T08:57:38+00:00"
"time": "2023-03-03T08:58:33+00:00"
}
],
"packages-dev": [],
......
......@@ -109,7 +109,7 @@ jQuery(document).ready(function(){
nextText: cartable.Syndicates.i18n.tabs.next,
prevClass: 'btn prev',
nextClass: 'btn next'
});
}).after('<div id="cartable-post-contribution-form"></div>');
// Align main form button, for tab integration
CRM.$('#_qf_Main_upload-bottom').addClass('float-right');
......
......@@ -28,6 +28,8 @@ var ApportionmentMonthAmount;
var MonthsToDispatchTo_ProRata;
var ProrataMonthAmount;
var isReadyForHumans = false;
const roundedAmountByMonths = function(value) {
return Math.round(AnnualContributionAmount / (value / 100)) / 100;
}
......@@ -117,7 +119,7 @@ const cartable_show_hide_payment_processors = function(){
}
}
const cartable_pick_membership_amount = function(){
const cartable_pick_membership_amount = function(event){
var raw_contribution_amount = SalarySelect.val();
if (raw_contribution_amount === '_FREE_'){
SalarySelect.after(
......@@ -239,6 +241,16 @@ const cartable_pick_membership_amount = function(){
CRM.$('.cartable-membership-frequency-selector.frequency-'+frequency_name).removeClass('inactive').addClass('active');
cartable_show_hide_payment_processors();
if (isReadyForHumans){
if(event.currentTarget == SalarySelect[0]){
location.hash = '#cartable-membership-frequency-selector';
}
else{
location.hash = '#cartable-post-contribution-form';
}
}
}
function cartable_fiscal_deducted(amount){
......@@ -584,6 +596,27 @@ jQuery(document).ready(function(){
}
});
jQuery('.crm-contribution-main-form-block').on('tab_open_2', function () {
setTimeout(function(){
location.hash = '#cartable-membership-selector';
}, 300);
if (isReadyForHumans && Frequency){
setTimeout(function(){
location.hash = '#cartable-post-contribution-form';
}, 600);
}
});
jQuery('.crm-contribution-main-form-block').on('tab_open_3', function () {
setTimeout(function(){
location.hash = '#cartable-tab-step-3';
}, 300);
});
jQuery('.crm-contribution-main-form-block').on('tab_open_4', function () {
setTimeout(function(){
location.hash = '#cartable-tab-step-4';
}, 300);
});
// Also pre-check frequency
setTimeout(function(){
if(GrilleSalarialeField && SalarySelect){
......@@ -599,6 +632,7 @@ jQuery(document).ready(function(){
FreqFieldChecked.prop('checked', 'checked').trigger('change');
}
}
isReadyForHumans = true;
return;
}
}
......@@ -613,6 +647,7 @@ jQuery(document).ready(function(){
CRM.$('#cartable-membership-frequency-yearly').prop('checked', 'checked').trigger('change');
}
}
isReadyForHumans = true;
cartable_autofill();
}, 1000);
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment