Skip to content

Commit ff3257f

Browse files
author
AMJones
committed
Version bump, updated dist.
1 parent 47ed140 commit ff3257f

File tree

7 files changed

+58
-24
lines changed

7 files changed

+58
-24
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sass"
99
],
1010
"homepage": "https://github.com/deviscoding/custom-time",
11-
"version": "1.0",
11+
"version": "1.0.2",
1212
"authors": [
1313
{
1414
"name": "AMJones",

dist/css/custom-time.css

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* CustomTime v1.0 (https://github.com/deviscoding/custom-time) with Icons from Open Iconic (https://useiconic.com/open)
2+
* CustomTime v1.0.2 (https://github.com/deviscoding/custom-time) with Icons from Open Iconic (https://useiconic.com/open)
33
* @author AMJones [am@jonesiscoding.com]
44
* @licence MIT (https://github.com/deviscoding/custom-time/blob/master/LICENSE)
55
*/
@@ -11,7 +11,7 @@
1111
}
1212

1313
.custom-time-wrapper {
14-
background: #fff url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%228%22%20viewBox%3D%220%200%208%208%22%3E%3Cpath%20fill%3D%22%23495057%22%20d%3D%22M4%200c-2.2%200-4%201.8-4%204s1.8%204%204%204%204-1.8%204-4-1.8-4-4-4zm0%201c1.66%200%203%201.34%203%203s-1.34%203-3%203-3-1.34-3-3%201.34-3%203-3zm-.5%201v2.22l.16.13.5.5.34.38.72-.72-.38-.34-.34-.34v-1.81h-1z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat left calc(0.375rem + 4px) center;
14+
background: #fff url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%208%208%22%3E%3Cpath%20fill%3D%22rgba%2873%2C%2080%2C%2087%2C%200.7%29%22%20d%3D%22M4%200c-2.2%200-4%201.8-4%204s1.8%204%204%204%204-1.8%204-4-1.8-4-4-4zm0%201c1.66%200%203%201.34%203%203s-1.34%203-3%203-3-1.34-3-3%201.34-3%203-3zm-.5%201v2.22l.16.13.5.5.34.38.72-.72-.38-.34-.34-.34v-1.81h-1z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat left calc(0.375rem + 4px) center;
1515
border: 1px solid #ced4da;
1616
border-radius: 2px;
1717
height: calc(2.25rem + 2px);
@@ -28,23 +28,54 @@
2828
display: none;
2929
}
3030

31-
.custom-time-wrapper .custom-h, .custom-time-wrapper .custom-i, .custom-time-wrapper .custom-s, .custom-time-wrapper .custom-a {
31+
.custom-time-wrapper select[class*="custom-time-"] {
32+
background-color: transparent;
3233
-webkit-appearance: none;
3334
-moz-appearance: none;
3435
appearance: none;
35-
background: transparent url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%228%22%20viewBox%3D%220%200%208%208%22%3E%3Cpath%20fill%3D%22rgba%2873%2C%2080%2C%2087%2C%200.5%29%22%20d%3D%22M0%200l4%204%204-4h-8z%22%20transform%3D%22translate%280%202%29%22%20%2F%3E%3C%2Fsvg%3E") no-repeat right 0.5rem center;
3636
border: none !important;
3737
border-radius: 0 !important;
3838
height: 100%;
39-
padding: 0 calc(1rem + 8px) 0 0.5rem;
39+
min-width: 2rem;
40+
text-align: center;
41+
padding: 0 3px 0 0;
4042
}
4143

42-
.custom-time-wrapper .custom-h:focus, .custom-time-wrapper .custom-i:focus, .custom-time-wrapper .custom-s:focus, .custom-time-wrapper .custom-a:focus {
44+
.custom-time-wrapper select[class*="custom-time-"] > option {
45+
padding: 0;
46+
}
47+
48+
.custom-time-wrapper select[class*="custom-time-"]:focus {
4349
outline: none;
50+
background-color: rgba(128, 189, 255, 0.5) !important;
4451
box-shadow: none;
4552
border: none;
4653
}
4754

55+
.custom-time-wrapper select[class*="custom-time-"]:hover {
56+
background-color: rgba(128, 189, 255, 0.7);
57+
}
58+
59+
.custom-time-wrapper select[class*="custom-time-"]::-ms-expand {
60+
opacity: 0;
61+
}
62+
63+
.custom-time-wrapper select[class*="custom-time-"]:-moz-focusring {
64+
color: transparent;
65+
text-shadow: 0 0 0 #000;
66+
}
67+
68+
.custom-time-wrapper select.custom-time-i, .custom-time-wrapper select.custom-time-s {
69+
background: transparent url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%228%22%20viewBox%3D%220%200%208%208%22%3E%3Cpath%20fill%3D%22rgba%2873%2C%2080%2C%2087%2C%200.7%29%22%20d%3D%22M3%2C7H5V5H3ZM3%2C3H5V1H3Z%22%2F%3E%3C%2Fsvg%3E") no-repeat left 2px center;
70+
padding: 0 0 0 4px;
71+
min-width: calc(2rem + 4px);
72+
margin-left: -2px;
73+
}
74+
75+
.custom-time-wrapper select.custom-time-a {
76+
min-width: 2.25rem;
77+
}
78+
4879
@media handheld, screen and (pointer: coarse) {
4980
.custom-time-wrapper:focus-within {
5081
border: none;
@@ -56,7 +87,7 @@
5687
display: inline-block;
5788
padding: 0;
5889
}
59-
.custom-time-wrapper .custom-h, .custom-time-wrapper .custom-i, .custom-time-wrapper .custom-s, .custom-time-wrapper .custom-a {
90+
.custom-time-wrapper select[class*="custom-time-"] {
6091
display: none;
6192
}
6293
}

dist/css/custom-time.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/custom-time.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* CustomTime v1.0 (https://github.com/deviscoding/custom-time)
2+
* CustomTime v1.0.2 (https://github.com/deviscoding/custom-time)
33
* @author AMJones [am@jonesiscoding.com]
44
* @licence MIT (https://github.com/deviscoding/custom-time/blob/master/LICENSE)
55
*/
@@ -50,11 +50,13 @@
5050
ct.update = function() {
5151
if(ct.$input.val() != ct.value) {
5252
ct.value = ct.$input.val();
53-
var t = parseTime(ct.value);
54-
ct.$hour.val( pad( t.h ) );
55-
ct.$min.val( pad( t.i ) );
56-
ct.$sec.val( pad( t.s ) );
57-
ct.$cnv.val( t.a );
53+
if(ct.value.length) {
54+
var t = parseTime(ct.value);
55+
ct.$hour.val( pad( t.h ) );
56+
ct.$min.val( pad( t.i ) );
57+
ct.$sec.val( pad( t.s ) );
58+
ct.$cnv.val( t.a );
59+
}
5860
} else {
5961
var a = ct.$cnv.val();
6062
var h = ct.$hour.val();
@@ -108,6 +110,7 @@
108110
ct.$min = getSelect( 'i' ).on( 'change blur', ct.update );
109111
ct.$sec = getSelect( 's' ).on( 'change blur', ct.update );
110112
ct.$cnv = getSelect( 'a' ).on( 'change blur', ct.update );
113+
ct.$input.on('change blur', ct.update);
111114

112115
ct.update();
113116
};
@@ -120,7 +123,7 @@
120123
var $sel = ct.$input.siblings( '.' + ct.settings.cls[ key ] );
121124
if ( !$sel.length ) {
122125
if(key === 'a') {
123-
$sel = $( '<select><option value=""></option><option value="am">AM</option><option value="pm">PM</option></select>' );
126+
$sel = $( '<select><option value="">--</option><option value="am">AM</option><option value="pm">PM</option></select>' );
124127
} else {
125128
$sel = makeSelect( { min: ct.min( key ), max: ct.max( key ), step: ct.step( key ) } );
126129
}
@@ -140,7 +143,7 @@
140143
var makeSelect = function(options) {
141144
var option = '<option value="#">#</option>';
142145
var $sel = $('<select></select>');
143-
$sel.append(option.replace(/#/g,''));
146+
$sel.append(option.replace(/#/g,'--'));
144147
for(var x = options.min || 0; x <= options.max; x = x + options.step) {
145148
var val = (x < 10) ? '0' + x : x;
146149
$sel.append(option.replace(/#/g,val));

dist/js/custom-time.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/custom-time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* CustomTime v1.0 (https://github.com/deviscoding/custom-time)
2+
* CustomTime v1.0.2 (https://github.com/deviscoding/custom-time)
33
* @author AMJones [am@jonesiscoding.com]
44
* @licence MIT (https://github.com/deviscoding/custom-time/blob/master/LICENSE)
55
*/

scss/_custom-time.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@if(variable_exists(use-framework)) {
44
@if not($use-framework) {
55
/**
6-
* CustomTime v1.0 (https://github.com/deviscoding/custom-time) with Icons from Open Iconic (https://useiconic.com/open)
6+
* CustomTime v1.0.2 (https://github.com/deviscoding/custom-time) with Icons from Open Iconic (https://useiconic.com/open)
77
* @author AMJones [am@jonesiscoding.com]
88
* @licence MIT (https://github.com/deviscoding/custom-time/blob/master/LICENSE)
99
*/

0 commit comments

Comments
 (0)