swapping dates in interval modal window bug fixed

remotes/origin/1203
pavel 11 years ago
parent 7888bd5acf
commit 37a3e388ab
  1. 17
      templates/client/static_client/js/_modules/block.search.js
  2. 2
      templates/client/static_client/js_min/_modules/block.search.min.js

@ -1602,6 +1602,7 @@ if (EXPO.searchBlock){
$modal = $('#'+self.opt.id), $modal = $('#'+self.opt.id),
$modalTrigger = $('#'+self.opt.modalTrigger), $modalTrigger = $('#'+self.opt.modalTrigger),
applyBtnClass = self.opt.applyBtnClass, applyBtnClass = self.opt.applyBtnClass,
$activeField,
/** /**
* make string from input:text values * make string from input:text values
* @returns {string} * @returns {string}
@ -1672,11 +1673,11 @@ if (EXPO.searchBlock){
/** /**
* swap values between date fields * swap values between date fields
*/ */
if(thatValInt > itValInt && thatValInt != 0 && thatValInt){ if(itValInt > thatValInt && itId == self.opt.dateFrom){
bfr = document.getElementById(itId).value; bfr = document.getElementById(itId).value;
document.getElementById(itId).value = document.getElementById(thatId).value; document.getElementById(itId).value = document.getElementById(thatId).value;
document.getElementById(thatId).value = bfr; document.getElementById(thatId).value = bfr;
}else if(thatValInt < itValInt && thatValInt != 0 && thatValInt){ }else if(itValInt < thatValInt && itId == self.opt.dateTo){
bfr = document.getElementById(thatId).value; bfr = document.getElementById(thatId).value;
document.getElementById(thatId).value = document.getElementById(itId).value; document.getElementById(thatId).value = document.getElementById(itId).value;
document.getElementById(itId).value = bfr; document.getElementById(itId).value = bfr;
@ -1702,7 +1703,7 @@ if (EXPO.searchBlock){
}).inputmask("99.99.9999",{ }).inputmask("99.99.9999",{
showMaskOnHover:false, showMaskOnHover:false,
'oncomplete': function () { 'oncomplete': function () {
checkInterval(this); $activeField = this;
} }
}); });
$dateTo.datepicker({ $dateTo.datepicker({
@ -1716,15 +1717,21 @@ if (EXPO.searchBlock){
}).inputmask("99.99.9999",{ }).inputmask("99.99.9999",{
showMaskOnHover:false, showMaskOnHover:false,
'oncomplete': function () { 'oncomplete': function () {
checkInterval(this); $activeField = this;
} }
}); });
$('input[type="text"]',$modal).on('change', function () { $('input[type="text"]',$modal).on('change', function () {
var stringToset = inputsTostring(); var stringToset = inputsTostring();
triggerSetText(stringToset); if (self.validate()){
triggerSetText(stringToset);
}
}); });
$('.'+applyBtnClass, $modal).on('click', function () { $('.'+applyBtnClass, $modal).on('click', function () {
if($activeField){
checkInterval($activeField);
}
self.applyHandler(this); self.applyHandler(this);
return false; return false;
}); });

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save