Skip to content

Commit

Permalink
fix some class names and ids, add gitignore, make sure dropdown is up…
Browse files Browse the repository at this point in the history
… to date when opened
  • Loading branch information
jdewit committed Apr 29, 2012
1 parent de3725c commit c0f1fef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.swp

15 changes: 8 additions & 7 deletions js/bootstrap-timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var Timepicker = function(element, options){
this.element = $(element);
this.step = options.step||this.element.data('time-step')||1;
this.picker = $('<div class="timepicker dropdown-menu">'+
this.picker = $('<div class="bootstrap-timepicker dropdown-menu">'+
'<div class="timepicker-container">'+
'<table>'+
'<tr>'+
Expand All @@ -33,10 +33,10 @@
'<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>'+
'</tr>'+
'<tr>'+
'<td id="timepicker-hour"></td> '+
'<td id="timepickerHour"></td> '+
'<td class="separator">:</td>'+
'<td id="timepicker-minute"></td> '+
'<td id="timepicker-meridian"></td>'+
'<td id="timepickerMinute"></td> '+
'<td id="timepickerMeridian"></td>'+
'</tr>'+
'<tr>'+
'<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
Expand Down Expand Up @@ -87,6 +87,7 @@
constructor: Timepicker,

show: function(e) {
this.setValue(this.getTime());
this.picker.show();
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
this.place();
Expand Down Expand Up @@ -153,9 +154,9 @@
} else {
this.element.prop('value', input);
}
$('.timepicker td#timepicker-hour').text(this.hour);
$('.timepicker td#timepicker-minute').text(this.minute < 10 ? '0' + this.minute : this.minute);
$('.timepicker td#timepicker-meridian').text(this.meridian);
$('.bootstrap-timepicker td#timepickerHour').text(this.hour);
$('.bootstrap-timepicker td#timepickerMinute').text(this.minute < 10 ? '0' + this.minute : this.minute);
$('.bootstrap-timepicker td#timepickerMeridian').text(this.meridian);
},

setValues: function(time) {
Expand Down
2 changes: 1 addition & 1 deletion less/timepicker.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.timepicker {
.bootstrap-timepicker {
top: 0;
left: 0;
padding: 4px;
Expand Down

0 comments on commit c0f1fef

Please sign in to comment.