Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor JS to behavior (inline JS script tags broke when ajax/pjax w…

…as used in combination with nested many)
  • Loading branch information...
commit cb602db4e681154a20bc9890f280c5d59cfda2d3 1 parent 299cf3d
@bbenezech bbenezech authored
View
3  app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee
@@ -7,7 +7,7 @@ $(document).ready ->
tab_content.children().last()
$('form').live 'nested:fieldAdded', (content) ->
- field = content.field.addClass('tab-pane');
+ field = content.field.addClass('tab-pane')
new_tab = $('<li><a data-toggle="tab" href="#' + field.attr('id') + '">' + field.children('.object-infos').data('object-label') + '</a></li>')
parent_group = field.closest('.control-group')
controls = parent_group.children('.controls')
@@ -15,6 +15,7 @@ $('form').live 'nested:fieldAdded', (content) ->
content = parent_group.children('.tab-content')
toggler = controls.find('.toggler')
nav.append(new_tab)
+ $(window.document).trigger('rails_admin.dom_ready') # fire dom_ready for new player in town
new_tab.children('a').tab('show') # activate added tab
nav.select(':hidden').show('slow') # show nav if hidden
content.select(':hidden').show('slow') # show tabs content if hidden
View
6 app/assets/javascripts/rails_admin/ra.remote-form.js
@@ -17,7 +17,7 @@
var widget = this
var dom_widget = widget.element;
- var edit_url = dom_widget.find('select').data('edit-url');
+ var edit_url = dom_widget.find('select').first().data('options') && dom_widget.find('select').first().data('options')['edit-url'];
if(typeof(edit_url) != 'undefined' && edit_url.length) {
dom_widget.find('.ra-multiselect option').live('dblclick', function(e){
widget._bindModalOpening(e, edit_url.replace('__ID__', this.value))
@@ -83,7 +83,9 @@
form.submit();
return false;
}).html(saveButtonText);
-
+
+ $(document).trigger('rails_admin.dom_ready')
+
form.bind("ajax:complete", function(xhr, data, status) {
if (status == 'error') {
dialog.find('.modal-body').html(data.responseText);
View
134 app/assets/javascripts/rails_admin/ra.widgets.coffee
@@ -0,0 +1,134 @@
+$(document).live 'rails_admin.dom_ready', ->
+
+ if $('form').length # don't waste time otherwise
+
+ # colorpicker
+
+ $('[data-color]').each ->
+ that = this
+ $(this).ColorPicker
+ color: $(that).val()
+ onShow: (el) ->
+ $(el).fadeIn(500)
+ false
+ onHide: (el) ->
+ $(el).fadeOut(500)
+ false
+ onChange: (hsb, hex, rgb) ->
+ $(that).val(hex)
+ $(that).css('backgroundColor', '#' + hex)
+
+ # datetime
+
+ $('[data-datetimepicker]').each ->
+ $(this).datetimepicker $(this).data('options')
+
+ # enumeration
+
+ $('[data-enumeration]').each ->
+ $(this).filteringSelect $(this).data('options')
+
+ # fileupload
+
+ $('[data-fileupload]').each ->
+ input = this
+ $(this).find(".delete input[type='checkbox']").live 'click', ->
+ $(input).children('.toggle').toggle('slow')
+
+ # filtering-multiselect
+
+ $('[data-filteringmultiselect]').each ->
+ $(this).filteringMultiselect $(this).data('options')
+ if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
+ $(this).parents('.control-group').find('.btn').remove()
+ else
+ $(this).parents('.control-group').first().remoteForm()
+
+ # filtering-select
+
+ $('[data-filteringselect]').each ->
+ $(this).filteringSelect $(this).data('options')
+ if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
+ $(this).parents('.control-group').find('.btn').remove()
+ else
+ $(this).parents('.control-group').first().remoteForm()
+
+ # nested-many
+
+ $('[data-nestedmany]').each ->
+ field = $(this).parents('.control-group').first()
+ nav = field.find('> .controls > .nav')
+ content = field.find('> .tab-content')
+ toggler = field.find('> .controls > .btn-group > .toggler')
+ # add each nested field to a tab-pane and reference it in the nav
+ content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
+ nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
+ # init first tab, toggler and content/tabs visibility
+ nav.find("> li > a[data-toggle='tab']:first").tab('show')
+ if nav.children().length == 0
+ nav.hide()
+ content.hide()
+ toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
+ else
+ if toggler.hasClass('active')
+ nav.show()
+ content.show()
+ toggler.children('i').addClass('icon-chevron-down')
+ else
+ nav.hide()
+ content.hide()
+ toggler.children('i').addClass('icon-chevron-right')
+
+ # nested-one
+
+ $('[data-nestedone]').each ->
+ field = $(this).parents('.control-group').first()
+ nav = field.find("> .controls > .nav")
+ content = field.find("> .tab-content")
+ toggler = field.find('> .controls > .toggler')
+ content.children(".fields:not(.tab-pane)").addClass('tab-pane').each ->
+ nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
+ first_tab = nav.find("> li > a[data-toggle='tab']:first")
+ first_tab.tab('show')
+ field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html())
+ if toggler.hasClass('active')
+ toggler.children('i').addClass('icon-chevron-down')
+ content.show()
+ else
+ toggler.children('i').addClass('icon-chevron-right')
+ content.hide()
+
+ # polymorphic-association
+
+ $('[data-polymorphic]').each ->
+ type_select = $(this)
+ field = type_select.parents('.control-group').first()
+ object_select = field.find('select').last()
+ urls = type_select.data('urls')
+ type_select.on 'change', (e) ->
+ if $(this).val() is ''
+ object_select.html('<option value=""></option>')
+ else
+ $.ajax
+ url: urls[type_select.val()]
+ data:
+ compact: true
+ all: true
+ beforeSend: (xhr) ->
+ xhr.setRequestHeader("Accept", "application/json")
+ success: (data, status, xhr) ->
+ html = '<option></option>'
+ $(data).each (i, el) ->
+ html += '<option value="' + el.id + '">' + el.label + '</option>'
+ object_select.html(html)
+
+ # ckeditor
+
+ $('[data-richtext=ckeditor]').each ->
+ window.CKEDITOR_BASEPATH = '/assets/ckeditor/'
+ options = $(this).data('options')
+ if not window.CKEDITOR
+ $(window.document).append('<script src="' + options['jspath'] + '"><\/script>')
+ if instance = window.CKEDITOR.instances[this.id]
+ window.CKEDITOR.remove(instance)
+ window.CKEDITOR.replace(this, options['options'])
View
2  app/assets/javascripts/rails_admin/rails_admin.js.erb
@@ -9,6 +9,7 @@
require_asset 'jquery.ui.datepicker'
require_asset 'rails_admin/jquery.ui.timepicker'
require_asset 'rails_admin/ra.datetimepicker'
+ require_asset 'rails_admin/jquery.colorpicker'
require_asset 'rails_admin/ra.filter-box'
require_asset 'rails_admin/ra.filtering-multiselect'
require_asset 'rails_admin/ra.filtering-select'
@@ -17,6 +18,7 @@
require_asset 'jquery_nested_form'
require_asset 'rails_admin/ra.nested-form-hooks'
require_asset 'bootstrap'
+ require_asset 'rails_admin/ra.widgets'
require_asset 'rails_admin/ui'
require_asset "rails_admin/themes/#{theme}/ui"
require_asset 'rails_admin/custom/ui'
View
3  app/assets/stylesheets/rails_admin/imports.css.scss.erb
@@ -1,5 +1,5 @@
<%
- theme = ENV['RAILS_ADMIN_THEME'] || :default
+ theme = ENV['RAILS_ADMIN_THEME'] || :cerulan
%>
/*** Variables ***/
@@ -25,6 +25,7 @@
@import "rails_admin/jquery.ui.timepicker";
@import "rails_admin/ra.calendar-additions";
@import "rails_admin/ra.filtering-multiselect";
+@import "rails_admin/jquery.colorpicker";
/*** Bootstrap Theming ***/
View
25 app/views/rails_admin/main/_form_colorpicker.html.haml
@@ -1,24 +1 @@
-- html_attributes = field.html_attributes.reverse_merge({:style => "background-color: #{field.color}"}).reverse_merge((hdv = field.html_default_value).nil? ? {} : { :value => hdv })
-= form.send field.view_helper, field.method_name, html_attributes
-
-= javascript_include_tag asset_path 'rails_admin/jquery.colorpicker.js'
-= stylesheet_link_tag asset_path 'rails_admin/jquery.colorpicker.css'
-= form.javascript_for(field) do
- :plain
- var input = $('#{ form.jquery_namespace(field) } input')
- input.css('backgroundColor', '#' + input.val());
- input.ColorPicker({
- color: input.val(),
- onShow: function (el) {
- $(el).fadeIn(500);
- return false;
- },
- onHide: function (el) {
- $(el).fadeOut(500);
- return false;
- },
- onChange: function (hsb, hex, rgb) {
- input.val(hex);
- input.css('backgroundColor', '#' + hex);
- }
- });
+= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({:style => "background-color: #{field.color}", :data => {:color => true}}).reverse_merge((hdv = field.html_default_value).nil? ? {} : { :value => hdv })
View
5 app/views/rails_admin/main/_form_datetime.html.haml
@@ -1,4 +1 @@
-= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge((hdv = field.html_default_value).nil? ? {} : { :value => hdv })
-= form.javascript_for(field) do
- :plain
- $("#{form.jquery_namespace(field)} input").datetimepicker(#{field.js_plugin_options.html_safe});
+= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({ :data => { :datetimepicker => true, :options => field.js_plugin_options.to_json } }).reverse_merge((hdv = field.html_default_value).nil? ? {} : { :value => hdv })
View
5 app/views/rails_admin/main/_form_enumeration.html.haml
@@ -1,4 +1 @@
-= form.select field.method_name, field.enum, { :include_blank => true }.merge((hdv = field.html_default_value).nil? ? {} : { :selected => hdv }), field.html_attributes.reverse_merge({ :placeholder => t('admin.misc.search') })
-= form.javascript_for(field) do
- :plain
- $("#{form.jquery_namespace(field)} select").filteringSelect({});
+= form.select field.method_name, field.enum, { :include_blank => true }.reverse_merge((hdv = field.html_default_value).nil? ? {} : { :selected => hdv }), field.html_attributes.reverse_merge({ :data => { :enumeration => true }, :placeholder => t('admin.misc.search') })
View
7 app/views/rails_admin/main/_form_file_upload.html.haml
@@ -3,7 +3,7 @@
.toggle{:style => ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')}
- if value = field.pretty_value
= value
- = form.file_field(field.name, field.html_attributes)
+ = form.file_field(field.name, field.html_attributes.reverse_merge({ :data => { :fileupload => true } }))
- if field.optional? && field.errors.blank? && file && field.delete_method
%a.btn.btn-info{:href => '#', :'data-toggle' => 'button', :onclick => "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false"}
%i.icon-white.icon-trash
@@ -11,8 +11,3 @@
= form.check_box(field.delete_method, :style => 'display:none;' )
- if field.cache_method
= form.hidden_field(field.cache_method)
-= form.javascript_for(field) do
- :plain
- $("#{form.jquery_namespace(field)} .delete input[type='checkbox']").live('click', function() {
- $(this).parents('.input').first().children('.toggle').toggle('slow');
- });
View
52 app/views/rails_admin/main/_form_filtering_multiselect.html.haml
@@ -10,50 +10,38 @@
end
selected_ids = selected.map{|s| s.send(field.associated_primary_key)}
-
current_action = params[:action].in?(['create', 'new']) ? 'create' : 'update'
-
- edit_url = authorized?(:edit, config.abstract_model) ? edit_path(:model_name => config.abstract_model.to_param, :id => '__ID__') : ''
-
+
xhr = !field.associated_collection_cache_all
-
+
collection = if xhr
selected.map { |o| [o.send(field.associated_object_label_method), o.send(field.associated_primary_key)] }
else
i = 0
controller.list_entries(config, :index, field.associated_collection_scope, false).map { |o| [o.send(field.associated_object_label_method), o.send(field.associated_primary_key)] }.sort_by {|a| [selected_ids.index(a[1]) || selected_ids.size, i+=1] }
end
-
+
+ js_data = {
+ :xhr => xhr,
+ :'edit-url' => (authorized?(:edit, config.abstract_model) ? edit_path(:model_name => config.abstract_model.to_param, :id => '__ID__') : ''),
+ :remote_source => index_path(config.abstract_model, :source_object_id => form.object.id, :source_abstract_model => source_abstract_model.to_param, :associated_collection => field.name, :current_action => current_action, :compact => true),
+ :sortable => !!field.orderable,
+ :cacheAll => !!field.associated_collection_cache_all,
+ :regional => {
+ :chooseAll => t("admin.misc.chose_all"),
+ :chosen => t("admin.misc.chosen", :name => config.label_plural),
+ :clearAll => t("admin.misc.clear_all"),
+ :search => t("admin.misc.search"),
+ :up => t("admin.misc.up"),
+ :down => t("admin.misc.down")
+ }
+ }
+
%input{:name => form.dom_name(field), :type => "hidden", :value => ""}
- selected_ids = (hdv = field.html_default_value).nil? ? selected_ids : hdv
-= form.select field.method_name, collection, { :selected => selected_ids, :object => form.object }, field.html_attributes.merge({:'data-edit-url' => edit_url, :multiple => true})
+= form.select field.method_name, collection, { :selected => selected_ids, :object => form.object }, field.html_attributes.reverse_merge({:data => { :filteringmultiselect => true, :options => js_data.to_json }, :multiple => true})
- if authorized? :new, config.abstract_model
- path_hash = { :model_name => config.abstract_model.to_param, :modal => true }
- path_hash.merge!({ :associations => { field.inverse_of => (form.object.id || 'new') } }) if field.inverse_of
= link_to "<i class=\"icon-plus icon-white\"></i> ".html_safe + wording_for(:link, :new, config.abstract_model), '#', :data => { :link => new_path(path_hash) }, :class => "create btn btn-info", :style => 'margin-left:10px'
-
-= form.javascript_for(field) do
- :plain
- $("#{form.jquery_namespace(field)} select").filteringMultiselect({
- xhr: #{xhr},
- createQuery: function(query) {
- return { query: query }
- },
- remote_source: "#{index_path(config.abstract_model, :source_object_id => form.object.id, :source_abstract_model => source_abstract_model.to_param, :associated_collection => field.name, :current_action => current_action, :compact => true).html_safe}",
- sortable: #{field.orderable ? 'true' : 'false'},
- cacheAll: #{field.associated_collection_cache_all ? 'true' : 'false'},
- regional: {
- chooseAll: "#{t("admin.misc.chose_all")}",
- chosen: "#{t("admin.misc.chosen", :name => config.label_plural)}",
- clearAll: "#{t("admin.misc.clear_all")}",
- search: "#{t("admin.misc.search")}",
- up: "#{t("admin.misc.up")}",
- down: "#{t("admin.misc.down")}"
- }
- });
- if($("#modal").length) { // hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
- $("#{form.jquery_namespace(field)} .btn").remove();
- } else {
- $("#{form.jquery_namespace(field)}").remoteForm();
- }
View
22 app/views/rails_admin/main/_form_filtering_select.html.haml
@@ -19,9 +19,14 @@
xhr = !field.associated_collection_cache_all
collection = xhr ? [[selected_name, selected_id]] : controller.list_entries(config, :index, field.associated_collection_scope, false).map { |o| [o.send(field.associated_object_label_method), o.send(field.associated_primary_key)] }
+
+ js_data = {
+ :xhr => xhr,
+ :remote_source => index_path(config.abstract_model.to_param, :source_object_id => form.object.id, :source_abstract_model => source_abstract_model.to_param, :associated_collection => field.name, :current_action => current_action, :compact => true)
+ }
- selected_id = (hdv = field.html_default_value).nil? ? selected_id : hdv
-= form.select field.method_name, collection, { :selected => selected_id, :include_blank => true }, field.html_attributes.reverse_merge({:placeholder => t('admin.misc.search')})
+= form.select field.method_name, collection, { :selected => selected_id, :include_blank => true }, field.html_attributes.reverse_merge({ :data => { :filteringselect => true, :options => js_data.to_json }, :placeholder => t('admin.misc.search') })
- if authorized? :new, config.abstract_model
- path_hash = { :model_name => config.abstract_model.to_param, :modal => true }
@@ -30,18 +35,3 @@
- if edit_url.present?
= link_to "<i class=\"icon-pencil icon-white\"></i> ".html_safe + wording_for(:link, :edit, config.abstract_model), '#', :data => { :link => edit_url }, :class => "btn btn-info update #{field.value.nil? && 'disabled'}", :style => 'float:left; margin-left:10px'
-
-= form.javascript_for(field) do
- :plain
- $("#{form.jquery_namespace(field)} select").filteringSelect({
- xhr: #{xhr},
- createQuery: function(query) {
- return { query: query }
- },
- remote_source: "#{index_path(config.abstract_model.to_param, :source_object_id => form.object.id, :source_abstract_model => source_abstract_model.to_param, :associated_collection => field.name, :current_action => current_action, :compact => true).html_safe}"
- });
- if($("#modal").length) { // hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
- $("#{form.jquery_namespace(field)} .btn").hide();
- } else {
- $("#{form.jquery_namespace(field)}").remoteForm();
- }
View
31 app/views/rails_admin/main/_form_nested_many.html.haml
@@ -1,4 +1,4 @@
-.controls
+.controls{:data => { :nestedmany => true }}
.btn-group
%a.btn.btn-info.toggler{:'data-toggle' => "button", :'data-target' => "#{form.jquery_namespace(field)} > .tab-content, #{form.jquery_namespace(field)} > .controls > .nav", :class => (field.active? ? 'active' : '')}
%i.icon-white
@@ -12,32 +12,3 @@
- if field.nested_form[:allow_destroy] || nested_form.options[:child_index] == "new_#{field.name}"
= nested_form.link_to_remove '<span class="btn btn-small btn-danger"><i class="icon-trash icon-white"></i></span>'.html_safe
= nested_form.generate({:action => :nested, :model_config => field.associated_model_config, :nested_in => field.name })
-
-= form.javascript_for(field) do
- :plain
- var field = $("#{form.jquery_namespace(field)}");
- var nav = field.find('> .controls > .nav');
- var content = field.find('> .tab-content');
- var toggler = field.find('> .controls > .btn-group > .toggler');
-
- // add each nested field to a tab-pane and reference it in the nav
- content.children(".fields").addClass('tab-pane').each(function(){
- nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>');
- });
-
- // init first tab, toggler and content/tabs visibility
- nav.find("> li > a[data-toggle='tab']:first").tab('show');
- if(nav.children().length == 0) {
- nav.hide(); content.hide();
- toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
- } else {
- if (toggler.hasClass('active')) {
- nav.show(); content.show();
- toggler.children('i').addClass('icon-chevron-down')
- } else {
- nav.hide(); content.hide();
- toggler.children('i').addClass('icon-chevron-right')
- }
- }
-
- // dynamic behaviour is in nested-form-hooks
View
29 app/views/rails_admin/main/_form_nested_one.html.haml
@@ -1,4 +1,4 @@
-.controls
+.controls{:data => { :nestedone => true }}
%ul.nav{:style => 'margin-bottom:0px; display:none'}
%a.btn.btn-info.toggler{:'data-toggle' => "button", :'data-target' => "#{form.jquery_namespace(field)} > .tab-content", :class => (field.active? ? 'active' : '') }
= form.errors_for(field)
@@ -7,29 +7,4 @@
- form.object.send("build_#{field.name}") unless form.object.send(field.name)
.tab-content
= form.fields_for field.name do |nested_form|
- = nested_form.generate({:action => :nested, :model_config => field.associated_model_config, :nested_in => field.name })
-
-= form.javascript_for(field) do
- :plain
- var field = $("#{form.jquery_namespace(field)}");
- var nav = field.find("> .controls > .nav");
- var content = field.find("> .tab-content");
- var toggler = field.find('> .controls > .toggler');
-
- content.children(".fields").addClass('tab-pane').each(function(){
- nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>');
- });
-
- var first_tab = nav.find("> li > a[data-toggle='tab']:first");
-
- first_tab.tab('show');
- field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html());
-
- if (toggler.hasClass('active')) {
- toggler.children('i').addClass('icon-chevron-down');
- content.show()
- } else {
- toggler.children('i').addClass('icon-chevron-right');
- content.hide()
- }
-
+ = nested_form.generate({:action => :nested, :model_config => field.associated_model_config, :nested_in => field.name })
View
26 app/views/rails_admin/main/_form_polymorphic_association.html.haml
@@ -6,29 +6,5 @@
selected = field.bindings[:object].send(field.association[:name])
column_type_dom_id = form.dom_id(field).sub(field.method_name.to_s, type_column)
-= form.select type_column, type_collection, {:include_blank => true, :selected => selected_type}, :id => column_type_dom_id
+= form.select type_column, type_collection, {:include_blank => true, :selected => selected_type}, :id => column_type_dom_id, :data => { :polymorphic => true, :urls => field.polymorphic_type_urls.to_json }
= form.select field.method_name, collection, {:include_blank => true, :selected => selected.try(:id)}, :style => "margin-left:10px;"
-
-= form.javascript_for(field) do
- :plain
- var urls = #{field.polymorphic_type_urls.to_json.html_safe };
- $("#{form.jquery_namespace(field)} ##{column_type_dom_id}").bind("change", function(e){
- if ("" == $(this).val()) {
- $("##{ form.dom_id(field) }").html('<option value=""></option>');
- } else {
- $.ajax({
- url: urls[$(this).val()],
- data: { compact: true, all: true },
- beforeSend: function(xhr) {
- xhr.setRequestHeader("Accept", "application/json");
- },
- success: function(data, status, xhr) {
- var html = '<option></option>';
- $(data).each(function(i, el) {
- html += '<option value="' + el.id + '">' + el.label + '</option>';
- });
- $("#{form.jquery_namespace(field)} ##{ form.dom_id(field) }").html(html);
- }
- });
- }
- });
View
22 app/views/rails_admin/main/_form_text.html.haml
@@ -1,9 +1,15 @@
-= form.text_area field.method_name, field.html_attributes.reverse_merge((hdv = field.html_default_value).nil? ? { :value => field.formatted_value } : { :value => hdv })
+:ruby
+ if field.ckeditor
+ richtext = 'ckeditor'
+ js_data = {
+ :jspath => '/assets/ckeditor/ckeditor.js',
+ :options => {
+ :customConfig => field.ckeditor_config_js
+ }
+ }
+ else
+ richtext = false
+ js_data = {}
+ end
-- if field.ckeditor
- = javascript_tag do
- var CKEDITOR_BASEPATH = '/assets/ckeditor/';
- = javascript_include_tag "/assets/ckeditor/ckeditor.js"
- = form.javascript_for(field, :modal => false) do
- :plain
- CKEDITOR.replace('#{form.dom_id(field)}', { customConfig : '#{field.ckeditor_config_js.html_safe}' });
+= form.text_area field.method_name, field.html_attributes.reverse_merge(:data => { :richtext => richtext, :options => js_data.to_json }).reverse_merge((hdv = field.html_default_value).nil? ? { :value => field.formatted_value } : { :value => hdv })
View
2  lib/rails_admin/config/fields/types/datetime.rb
@@ -107,8 +107,6 @@ def js_plugin_options
}
options = options.merge self.class.js_plugin_options
-
- ActiveSupport::JSON.encode(options).html_safe
end
def localized_format(scope = [:time, :formats])
Please sign in to comment.
Something went wrong with that request. Please try again.