Closed ghost closed 11 years ago
When my input does not have the id attribute, the plugin does not work.
The following code uses the id attribute of input element to locate it in the line 3. This will fail if i don't have the id in my element.
show: function (n) { var widget = $('#' + this.data('monthpicker').settings.id); var monthpicker = $('#' + this.data('monthpicker').target.attr("id") + ':eq(0)'); widget.css("top", monthpicker.offset().top + monthpicker.outerHeight()); widget.css("left", monthpicker.offset().left); widget.show(); widget.find('select').focus(); this.trigger('monthpicker-show'); },
Proposed correction:
show: function (n) { var widget = $('#' + this.data('monthpicker').settings.id); var monthpicker = $(this.data('monthpicker').target); widget.css("top", monthpicker.offset().top + monthpicker.outerHeight()); widget.css("left", monthpicker.offset().left); widget.show(); widget.find('select').focus(); this.trigger('monthpicker-show'); },
@viniciusmlimarj it was corrected some commits ago, thank you!
When my input does not have the id attribute, the plugin does not work.
The following code uses the id attribute of input element to locate it in the line 3. This will fail if i don't have the id in my element.
show: function (n) { var widget = $('#' + this.data('monthpicker').settings.id); var monthpicker = $('#' + this.data('monthpicker').target.attr("id") + ':eq(0)'); widget.css("top", monthpicker.offset().top + monthpicker.outerHeight()); widget.css("left", monthpicker.offset().left); widget.show(); widget.find('select').focus(); this.trigger('monthpicker-show'); },
Proposed correction: