Commit 78ddaf63 authored by Liam Sharpe's avatar Liam Sharpe Committed by Robert Lyon
Browse files

Added calendar icon to all calendar fields - Bug #1543884

behatnotneeded

Change-Id: I03788cc684c28d36c921fe414cc93d511a8d4eab
parent a56663b1
......@@ -59,9 +59,9 @@ function pieform_element_calendar(Pieform $form, $element) {
}
// Build the HTML
$result = '<input type="text"'
$result = '<span class="hasDatepickerwrapper"><input type="text"'
. $form->element_attributes($element)
. ' value="' . $value . '">';
. ' value="' . $value . '"></span>';
$result .= '<script type="application/javascript">
var input = jQuery("input#' . $id . '");';
if (!empty($options['showsTime'])) {
......
......@@ -170,18 +170,33 @@ label,
vertical-align: top;
}
.hasDatepickerwrapper input[type="text"],
.hasDatepickerwrapperacl input[type="text"] {
position: relative;
}
.hasDatepicker {
padding-right: 20px;
}
.hasDatepickerwrapper:after {
font-family: "FontAwesome";
font-size: 16px;
content: "\f073";
color: lighten($text-color, 20%);
position:relative;
right: 20px;
}
.hasDatepickerwrapperacl:after {
font-family: "FontAwesome";
font-size: 16px;
content: "\f073";
color: lighten($text-color, 20%);
right: 10px;
position: absolute;
font-size: 16px;
top: 3px;
}
.date-picker {
position: relative;
&:before {
font-family: "FontAwesome";
font-size: 16px;
content: '\f073';
color: lighten($text-color, 20%);
position:absolute;
right: 10px;
top: 5px;
z-index: 0;
}
input.form-control {
width: 100%;
max-width:100%;
......
......@@ -89,12 +89,12 @@
</td>
<td class="text-center js-date short" data-name='from'>
<div class="date-picker js-date-picker js-hide-empty {% if (o.presets.empty) { %}hidden{% } %}">
<input type="text" name="accesslist[{%=o.id%}][startdate]" class="form-control pull-left" data-setmin="true" setdatatarget="to" value="{%=o.presets.startdate%}" {% if (o.presets.locked) { %}disabled{% } %}>
<span class="hasDatepickerwrapperacl"><input type="text" name="accesslist[{%=o.id%}][startdate]" class="form-control pull-left" data-setmin="true" setdatatarget="to" value="{%=o.presets.startdate%}" {% if (o.presets.locked) { %}disabled{% } %}></span>
</div>
</td>
<td class="text-center js-date short" data-name='to'>
<div class="date-picker js-date-picker js-hide-empty {% if (o.presets.empty) { %}hidden{% } %}">
<input type="text" name="accesslist[{%=o.id%}][stopdate]" class="form-control pull-left " data-setmax="true" setdatatarget="from" value="{%=o.presets.stopdate%}" {% if (o.presets.locked) { %}disabled{% } %}>
<span class="hasDatepickerwrapperacl"><input type="text" name="accesslist[{%=o.id%}][stopdate]" class="form-control pull-left " data-setmax="true" setdatatarget="from" value="{%=o.presets.stopdate%}" {% if (o.presets.locked) { %}disabled{% } %}></span>
</div>
</td>
{% if (o.viewtype !== "profile") { %}
......@@ -308,7 +308,7 @@ jQuery(function($) {
function attachEventListeners(id) {
var newrow = $('#accesslistitems').find('[data-id="' + id + '"]');
attachShareTypeEvent(newrow);
setDatePicker($(newrow).find('.js-date-picker > input'));
setDatePicker($(newrow).find('.js-date-picker > span > input'));
attachSelect2Search($(newrow).find('.js-select2-search'));
attachCommentEvents($(newrow));
onChange($(newrow));
......@@ -538,7 +538,7 @@ jQuery(function($) {
shareoptions = shareWithOptions(rows[i]);
renderAccessList(shareoptions);
setDatePicker($( ".js-date-picker > input" ));
setDatePicker($( ".js-date-picker > span > input" ));
});
});
......
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