Hi everybody,
I am using the side-panel (http://themes.semicolonweb.com/html/canvas/side-panel.php) to offer my customers a input form.
In this input form I like to use a datepicker (http://themes.semicolonweb.com/html/canvas/component-datepicker.php).
So my code looks like:
<div class="body-overlay"></div>
<div id="side-panel">
<div id="side-panel-trigger-close" class="side-panel-trigger"><a href="#"><i class="icon-line-cross"></i></a></div>
<div class="side-panel-wrap" id="form-overlay">
<!-- clockpicker -->
<div id="my-side-panel-form" style="display: none;">
from: <input type="text" class="form-control datepicker" placeholder="dd.mm.yyyy" value="" />Now I have the problem that as soon as I select a value with the datepicker the side-panel closes. I am close to a fix, but I think my solutions are very dirty:
- datepicker inside side-panel
the datepicker container is not created inside the side-panel div. Therefore if I click anywhere of the datepicker box, it is a click outside side-panel and the side-panel closes. So I change the code inside datepicker.js:
show: function(){
if (!this.isInline)
//this.picker.appendTo('body');
this.picker.appendTo('#form-overlay');Due to this change from body to #form-overlay the container for the datepicker is created inside and so a click does not close the side-panel.
- second hack of datepicker
Inside the function "_setDate: function(date, which){" I commented the line "fill()".
Now as soon as I select a date the datepicker box keeps open and I can close it by click besides the boxes.
These two dirty hacks make it possible to use a datepicker inside a side-panel. But I would like to make the datepicker box close automatically as soon as I select a date. But the side-panel should stay open.
But I assume that there might be a more simple or elegant solution.
Can you assist me finding this solution?
Best regards
Christoph
