app/helpers/adminpanel/adminpanel_form_builder.rb in adminpanel-3.2.1 vs app/helpers/adminpanel/adminpanel_form_builder.rb in adminpanel-3.3.0

- old
+ new

@@ -6,10 +6,11 @@ alias_method :text_area_original, :text_area alias_method :password_field_original, :password_field alias_method :number_field_original, :number_field alias_method :email_field_original, :email_field alias_method :file_field_original, :file_field + alias_method :time_select_original, :time_select def body(&block) @template.content_tag :div, class: 'widget-body' do @template.content_tag :div, class: 'widget-forms clearfix' do yield @@ -53,13 +54,14 @@ def wysiwyg_field(method, *args) options = args.extract_options! + options[:trix_id] = "trix-#{method}-#{self.object.object_id}" hidden_field( method, - id: "#{self.object.class.to_s.demodulize}-trix-#{method}" + id: options[:trix_id] ) + base_layout( method, options, 'trix_field' ) @@ -150,10 +152,14 @@ def datepicker(method, *args) base_layout( method, *args, 'datepickerize_base' ) end + def hours_select(method, *args) + base_layout( method, *args, 'time_select_original' ) + end + # def prepend_field(name, *args) # # options = args.extract_options! # # options.reverse_merge! :label => name @@ -205,12 +211,13 @@ # ) # end # end protected + def trix_field(method, *args) options = args.extract_options! - options.reverse_merge! input: "#{self.object.class.to_s.demodulize}-trix-#{method}", id: "#{method}-trix-editor" + options.reverse_merge! input: options[:trix_id], id: "#{method}-trix-editor" options[:class] << ' trix-content' options[:data] ||= {} editor_images = [] if options['uploader'].present? options[:data][:uploader_name] = options['uploader'].to_s