Skip to content

Commit

Permalink
Update to 2.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
shekibobo committed May 28, 2014
1 parent 8fc4abe commit 5269434
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
40 changes: 24 additions & 16 deletions app/assets/javascripts/jquery.xdan.datetimepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @preserve jQuery DateTimePicker plugin v2.2.6
* @preserve jQuery DateTimePicker plugin v2.2.7
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
* (c) 2014, Chupurnov Valeriy.
*/
Expand Down Expand Up @@ -158,19 +158,17 @@
dayOfWeek: [
"CN", "T2", "T3", "T4", "T5", "T6", "T7"
]
},
}
},
value:'',
lang: 'en',
lang:'en',

format: 'Y/m/d H:i',
format: 'Y/m/d H:i',
formatTime: 'H:i',
formatDate: 'Y/m/d',

startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',

//fromUnixtime: false,

step:60,
monthChangeSpinner:true,
closeOnDateSelect:false,
Expand Down Expand Up @@ -474,9 +472,9 @@
}

if( options.inline ) {
triggerAfterOpen = true;
datetimepicker.addClass('xdsoft_inline');
input.after(datetimepicker).hide();
datetimepicker.trigger('afterOpen.xdsoft');
}

if( options.inverseButton ) {
Expand Down Expand Up @@ -643,8 +641,10 @@
});
}
options.dayOfWeekStartPrev = (options.dayOfWeekStart==0)?6:options.dayOfWeekStart-1;

datetimepicker
.trigger('xchange.xdsoft');
.trigger('xchange.xdsoft')
.trigger('afterOpen.xdsoft')
};

datetimepicker
Expand All @@ -660,6 +660,7 @@
var scroll_element = timepicker.find('.xdsoft_time_box');
scroll_element.append(timebox);
scroll_element.xdsoftScroller();

datetimepicker.on('afterOpen.xdsoft',function() {
scroll_element.xdsoftScroller();
});
Expand Down Expand Up @@ -985,7 +986,8 @@
opt+='<div class="xdsoft_option '+(_xdsoft_datetime.currentTime.getMonth()==i?'xdsoft_current':'')+'" data-value="'+i+'">'+options.i18n[options.lang].months[i]+'</div>';
}
monthselect.children().eq(0).html(opt);
$(datetimepicker).trigger('generate.xdsoft');
$(datetimepicker)
.trigger('generate.xdsoft');
},10);
event.stopPropagation();
})
Expand All @@ -1004,8 +1006,9 @@
top = timebox.find(classType).index()*options.timeHeightInTimePicker+1;
if( (height-pheight)<top )
top = height-pheight;
timebox.css('marginTop','-'+parseInt(top)+'px');
timeboxparent.trigger('scroll_element.xdsoft_scroller',[parseInt(top)/(height-pheight)]);
}else{
timeboxparent.trigger('scroll_element.xdsoft_scroller',[0]);
}
}
});
Expand All @@ -1021,9 +1024,10 @@
if( $this.hasClass('xdsoft_disabled') )
return false;

currentTime.setDate( $this.data('date') );
currentTime.setMonth( $this.data('month') );
currentTime.setDate( 1 );
currentTime.setFullYear( $this.data('year') );
currentTime.setMonth( $this.data('month') );
currentTime.setDate( $this.data('date') );

datetimepicker.trigger('select.xdsoft',[currentTime]);

Expand Down Expand Up @@ -1095,7 +1099,8 @@
event.stopPropagation();
return fl;
});


var triggerAfterOpen = false;
datetimepicker
.on('changedatetime.xdsoft',function() {
if( options.onChangeDateTime&&options.onChangeDateTime.call ) {
Expand All @@ -1107,6 +1112,10 @@
.on('generate.xdsoft',function() {
if( options.onGenerate&&options.onGenerate.call )
options.onGenerate.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
if( triggerAfterOpen ){
datetimepicker.trigger('afterOpen.xdsoft');
triggerAfterOpen = false;
}
})
.on( 'click.xdsoft', function( xdevent )
{
Expand Down Expand Up @@ -1151,7 +1160,6 @@
}
if( onShow!==false ) {
datetimepicker.show();
datetimepicker.trigger('afterOpen.xdsoft');
setPos();
$(window)
.off('resize.xdsoft',setPos)
Expand Down Expand Up @@ -1200,8 +1208,6 @@

_xdsoft_datetime.setCurrentTime( getCurrentValue() );

datetimepicker.trigger('afterOpen.xdsoft');

input
.data( 'xdsoft_datetimepicker',datetimepicker )
.on('open.xdsoft focusin.xdsoft mousedown.xdsoft',function(event) {
Expand All @@ -1211,6 +1217,8 @@
timer = setTimeout(function() {
if( input.is(':disabled')||input.is(':hidden')||!input.is(':visible') )
return;

triggerAfterOpen = true;
_xdsoft_datetime.setCurrentTime(getCurrentValue());

datetimepicker.trigger('open.xdsoft');
Expand Down
2 changes: 1 addition & 1 deletion lib/xdan-datetimepicker-rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module XdanDatetimepickerRails
VERSION = "2.2.6.0"
VERSION = '2.2.7'
end

0 comments on commit 5269434

Please sign in to comment.