Bug fixed

Padding button  fixed
This commit is contained in:
Valeriy 2013-11-26 15:58:34 +06:00
parent f4cf038d20
commit 5e02ecd865
3 changed files with 24 additions and 15 deletions

View File

@ -1,5 +1,8 @@
<html> <!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="jquery.datetimepicker.css"/> <link rel="stylesheet" type="text/css" href="jquery.datetimepicker.css"/>
</head>
<body> <body>
<h3>DateTimePicker</h3> <h3>DateTimePicker</h3>
<input type="text" value="2014/03/15 05:06" id="datetimepicker"/><br><br> <input type="text" value="2014/03/15 05:06" id="datetimepicker"/><br><br>

View File

@ -60,10 +60,10 @@
float:left; float:left;
text-align:center; text-align:center;
margin-left:8px; margin-left:8px;
margin-top:5px; margin-top:0px;
} }
.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{ .xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{
margin-top:15px; margin-top:10px;
} }
.xdsoft_datetimepicker .xdsoft_mounthpicker{ .xdsoft_datetimepicker .xdsoft_mounthpicker{
position: relative; position: relative;
@ -106,19 +106,23 @@
background-position:-40px -15px; background-position:-40px -15px;
height: 15px; height: 15px;
width: 30px; width: 30px;
display: inline-block; display: block;
margin-left:14px;
margin-top:5px;
} }
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{
background-position:-40px 0px; background-position:-40px 0px;
margin-bottom:5px;
margin-top:0px;
} }
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box{ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box{
height:150px; height:151px;
overflow:hidden; overflow:hidden;
border-bottom:1px solid #DDDDDD; border-bottom:1px solid #DDDDDD;
} }
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div{ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div{
background: #F5F5F5; background: #F5F5F5;
border:1px solid #DDDDDD; border-top:1px solid #DDDDDD;
color: #666666; color: #666666;
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
@ -128,8 +132,9 @@
height:25px; height:25px;
line-height:25px; line-height:25px;
} }
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:last-child{
border-bottom-width:1px; .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child{
border-top-width:0px;
} }
.xdsoft_datetimepicker .xdsoft_next:hover, .xdsoft_datetimepicker .xdsoft_next:hover,
.xdsoft_datetimepicker .xdsoft_prev:hover { .xdsoft_datetimepicker .xdsoft_prev:hover {
@ -224,6 +229,7 @@
.xdsoft_time_box{ .xdsoft_time_box{
position:relative; position:relative;
border:1px solid #ccc;
} }
.xdsoft_time_box > .xdsoft_scrollbar >.xdsoft_scroller{ .xdsoft_time_box > .xdsoft_scrollbar >.xdsoft_scroller{
background:#ccc !important; background:#ccc !important;

View File

@ -157,7 +157,7 @@
if( !options.timepickerScrollbar ) if( !options.timepickerScrollbar )
return; return;
var sbh = scrollbar.height()-scroller[0].offsetHeight, var sbh = scrollbar.height()-scroller[0].offsetHeight,
pheight = timeboxparent[0].offsetHeight, pheight = timeboxparent[0].offsetHeight-2,
height = timebox[0].offsetHeight, height = timebox[0].offsetHeight,
percent = offset/(height-pheight); percent = offset/(height-pheight);
scroller.css('margin-top',sbh*percent); scroller.css('margin-top',sbh*percent);
@ -165,7 +165,7 @@
.on( 'open.xdsoft',function( event ){ .on( 'open.xdsoft',function( event ){
if( !options.timepickerScrollbar ) if( !options.timepickerScrollbar )
return; return;
var pheight = timeboxparent[0].offsetHeight; var pheight = timeboxparent[0].offsetHeight-2;
height = timebox[0].offsetHeight, height = timebox[0].offsetHeight,
percent = pheight/height, percent = pheight/height,
sh = percent*scrollbar[0].offsetHeight; sh = percent*scrollbar[0].offsetHeight;
@ -182,7 +182,7 @@
datetimepicker.on('scroll.scrollbar',function(event,offset){ datetimepicker.on('scroll.scrollbar',function(event,offset){
var sbh = scrollbar[0].offsetHeight-scroller[0].offsetHeight, var sbh = scrollbar[0].offsetHeight-scroller[0].offsetHeight,
percent = offset/sbh; percent = offset/sbh;
pheight = timeboxparent[0].offsetHeight, pheight = timeboxparent[0].offsetHeight-2,
height = timebox[0].offsetHeight; height = timebox[0].offsetHeight;
timebox.css('marginTop',-parseInt((height-pheight)*percent)) timebox.css('marginTop',-parseInt((height-pheight)*percent))
}); });
@ -275,7 +275,7 @@
timepicker.find('.xdsoft_prev,.xdsoft_next').mousedown(function(){ timepicker.find('.xdsoft_prev,.xdsoft_next').mousedown(function(){
var $this = $(this), timer = 0, stop = false, period = 110; var $this = $(this), timer = 0, stop = false, period = 110;
(function(v){ (function(v){
var pheight = timebox.parent()[0].offsetHeight, var pheight = timeboxparent[0].offsetHeight-2,
height = timebox[0].offsetHeight, height = timebox[0].offsetHeight,
top = Math.abs(parseInt(timebox.css('marginTop'))); top = Math.abs(parseInt(timebox.css('marginTop')));
if( $this.hasClass(options.next) && (height-pheight)- options.timeHeightInTimePicker>=top ){ if( $this.hasClass(options.next) && (height-pheight)- options.timeHeightInTimePicker>=top ){
@ -366,9 +366,9 @@
}); });
datetimepicker.on( 'open.xdsoft',function(){ datetimepicker.on( 'open.xdsoft',function(){
if( timebox.find('.xdsoft_current').length ){ if( timebox.find('.xdsoft_current').length ){
var pheight = timebox.parent()[0].offsetHeight, var pheight = timeboxparent[0].offsetHeight-2,
height = timebox[0].offsetHeight, height = timebox[0].offsetHeight,
top = timebox.find('.xdsoft_current').index()*options.timeHeightInTimePicker; top = timebox.find('.xdsoft_current').index()*options.timeHeightInTimePicker+1;
if( (height-pheight)<top ) if( (height-pheight)<top )
top = height-pheight; top = height-pheight;
timebox.css('marginTop','-'+parseInt(top)+'px'); timebox.css('marginTop','-'+parseInt(top)+'px');
@ -414,7 +414,7 @@
datetimepicker.mousewheel&&timepicker.mousewheel(function(event, delta, deltaX, deltaY) { datetimepicker.mousewheel&&timepicker.mousewheel(function(event, delta, deltaX, deltaY) {
if( !options.scrollTime ) if( !options.scrollTime )
return true; return true;
var pheight = timebox.parent()[0].offsetHeight, var pheight = timeboxparent[0].offsetHeight-2,
height = timebox[0].offsetHeight, height = timebox[0].offsetHeight,
top = Math.abs(parseInt(timebox.css('marginTop'))), top = Math.abs(parseInt(timebox.css('marginTop'))),
fl = true; fl = true;