parent
6d510b8031
commit
877fc87632
5 changed files with 115 additions and 51 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,83 @@ |
||||
var EXPO = EXPO || {}; //isolated namespace
|
||||
if (EXPO.translator) { |
||||
console.warn('WARNING: EXPO.translator is already defined!'); |
||||
} else { |
||||
EXPO.translator = (function () { |
||||
/** |
||||
* private (visible inside this module only) variables |
||||
*/ |
||||
/** |
||||
* @type {Object} - module API interafce realization |
||||
*/ |
||||
var that = {}; |
||||
/** |
||||
* @type {Object} default setting |
||||
*/ |
||||
that.opt = {}; |
||||
/** |
||||
* dependencies.Place where you can switch on dependencies for module |
||||
* @type {EXPO.common|*} - mostly used in project functions and data (block.common.js) |
||||
*/ |
||||
var com = EXPO.common; |
||||
|
||||
/** |
||||
* current module general initialization |
||||
* @param {Object} options - options recieved from web page view |
||||
*/ |
||||
that.init = function (options) { |
||||
/** |
||||
* default module options |
||||
* @type {Object} |
||||
*/ |
||||
this.opt = { |
||||
fromDateId:"id_fr", |
||||
toDateId:"id_to" |
||||
|
||||
}; |
||||
// settings extending
|
||||
$.extend(this.opt, options); |
||||
// begin of initialization
|
||||
var self = this, |
||||
opt = this.opt, |
||||
$dateFrom = $(document.getElementById(opt.fromDateId)), |
||||
$dateTo = $(document.getElementById(opt.toDateId)); |
||||
$(function () { |
||||
$.datepicker.setDefaults($.datepicker.regional["ru"]); |
||||
|
||||
$dateFrom.datepicker({ |
||||
dateFormat: 'dd.mm.yy', |
||||
showOn: 'button', |
||||
showOtherMonths: true, |
||||
constrainInput: true, |
||||
onClose: function( selectedDate ) { |
||||
$dateTo.datepicker( "option", "minDate", selectedDate ); |
||||
} |
||||
}).inputmask("99.99.9999",{ |
||||
showMaskOnHover:false, |
||||
insertMode:false, |
||||
'oncomplete': function () { |
||||
$activeField = this; |
||||
} |
||||
}); |
||||
$dateTo.datepicker({ |
||||
dateFormat: 'dd.mm.yy', |
||||
showOn: 'button', |
||||
showOtherMonths: true, |
||||
constrainInput: true, |
||||
onClose: function( selectedDate ) { |
||||
$dateFrom.datepicker( "option", "maxDate", selectedDate ); |
||||
} |
||||
}).inputmask("99.99.9999",{ |
||||
showMaskOnHover:false, |
||||
insertMode:false, |
||||
'oncomplete': function () { |
||||
$activeField = this; |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
|
||||
}; |
||||
return that; |
||||
}()); |
||||
} |
||||
@ -0,0 +1 @@ |
||||
var EXPO=EXPO||{};EXPO.translator?console.warn("WARNING: EXPO.translator is already defined!"):EXPO.translator=function(){var t={};t.opt={};EXPO.common;return t.init=function(t){this.opt={fromDateId:"id_fr",toDateId:"id_to"},$.extend(this.opt,t);var e=this.opt,o=$(document.getElementById(e.fromDateId)),n=$(document.getElementById(e.toDateId));$(function(){$.datepicker.setDefaults($.datepicker.regional.ru),o.datepicker({dateFormat:"dd.mm.yy",showOn:"button",showOtherMonths:!0,constrainInput:!0,onClose:function(t){n.datepicker("option","minDate",t)}}).inputmask("99.99.9999",{showMaskOnHover:!1,insertMode:!1,oncomplete:function(){$activeField=this}}),n.datepicker({dateFormat:"dd.mm.yy",showOn:"button",showOtherMonths:!0,constrainInput:!0,onClose:function(t){o.datepicker("option","maxDate",t)}}).inputmask("99.99.9999",{showMaskOnHover:!1,insertMode:!1,oncomplete:function(){$activeField=this}})})},t}(); |
||||
Loading…
Reference in new issue