remotes/origin/1203
pavel 11 years ago
parent fd1e88573a
commit 8843064aca
  1. 13
      templates/client/service/tour.html
  2. 83
      templates/client/static_client/js/_modules/page.tour.js

@ -293,7 +293,8 @@
<div class="rq-to-hide">
{% include 'includes/event_steps.html' with event=exposition filter=filter %}
{% comment %}
<div class="s-tour">
<div class="sect-title">{% trans 'Или организуйте поездку самостоятельно' %}:</div>
<div class="m-article">
@ -319,7 +320,7 @@
</div>
</div>
</div>
{% endcomment %}
<div class="s-comments">
<div class="sect-title">{% trans 'Отзывы клиентов' %}:</div>
@ -462,4 +463,12 @@
</div>
{% if request.GET.debug == '1' %}
<script src="{% static 'client/js/_modules/page.tour.js' %}"></script>
{% else %}
<script src="{% static 'client/js_min/_modules/page.tour.min.js' %}"></script>
{% endif %}
<script>
EXPO.tour.init({});
</script>
{% endblock %}

@ -0,0 +1,83 @@
var EXPO = EXPO || {}; //isolated namespace
if (EXPO.tour) {
console.warn('WARNING: EXPO.tour is already defined!');
} else {
EXPO.tour = (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;
}());
}
Loading…
Cancel
Save