Update disable time when separated picker new or reset date
This commit is contained in:
parent
b49251afee
commit
48ce2278d0
|
@ -13,15 +13,14 @@ $(document).ready(function(){
|
|||
$('.separated_picker div').on("changeDate",function(){
|
||||
if ($(this).hasClass('date_picker'))
|
||||
{
|
||||
if ($(this).find('input').val())
|
||||
if ($(this).find('input').val() && $(this).siblings('div').css('pointer-events'))
|
||||
{
|
||||
|
||||
$(this).siblings('div').css('pointer-events', '');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).siblings('div').find('input').val(null);
|
||||
$(this).siblings('div').disabled = true;
|
||||
$(this).siblings('div').unbind('click');
|
||||
$(this).siblings('div').css('pointer-events', 'none');
|
||||
}
|
||||
}
|
||||
$(this).siblings('input').val($(this).find('input').val() + ' ' + $(this).siblings('div').find('input').val());
|
||||
|
|
|
@ -65,6 +65,7 @@ module OrbitFormHelper
|
|||
def separated_picker(object_name, method, options)
|
||||
custom = {}
|
||||
custom[:no_label] = true
|
||||
custom[:separated] = true
|
||||
date_picker(nil, nil, options.merge(custom)) + time_picker(nil, nil, options.merge(custom))
|
||||
end
|
||||
|
||||
|
@ -80,7 +81,7 @@ module OrbitFormHelper
|
|||
end
|
||||
|
||||
def picker(object_name, method, options)
|
||||
content_tag :div, :class => "#{options[:picker_class]} input-append" do
|
||||
content_tag :div, :class => "#{options[:picker_class]} input-append", :style => "#{(options[:picker_class].eql?('time_picker') && options[:value].blank? && options[:separated]) ? 'pointer-events:none' : nil}" do
|
||||
concat label_tag options[:label] unless options[:no_label]
|
||||
concat text_field object_name, method, :placeholder => options[:placeholder], :class => options[:input_class], 'data-format' => options[:format], :value => options[:value]
|
||||
concat (content_tag :span, :class => 'add-on clearDate' do
|
||||
|
|
Reference in New Issue