bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 574 forks source link

When using "date" field, "html_attrs" is not set #560

Open thiago-negri opened 7 years ago

thiago-negri commented 7 years ago

Function setHtmlAttributes , defined as follows:

    setHtmlAttributes: function () {
        'use strict';
        var formField = this.element.find(this.formType);

        if (this.html_attrs) {
            var attrs = this.html_attrs;
            $.each(attrs, function (key, val) {
                formField.attr(key, val);
            });
        }
    },

Is unable to set attributes for date input type, as this.formType == 'date', so this.element.find('date') will return a zero-length jQuery selection.