Fix issue with dotted ids.
Closes Gh-54
This commit is contained in:
parent
2f95023612
commit
d399196f52
|
@ -43,7 +43,7 @@
|
||||||
};
|
};
|
||||||
Chosen.prototype.set_up_html = function() {
|
Chosen.prototype.set_up_html = function() {
|
||||||
var container_div, dd_top, dd_width, sf_width;
|
var container_div, dd_top, dd_width, sf_width;
|
||||||
this.container_id = this.form_field.id.length ? this.form_field.id : this.generate_field_id();
|
this.container_id = this.form_field.id.length ? this.form_field.id.replace('.', '_') : this.generate_field_id();
|
||||||
this.container_id += "_chzn";
|
this.container_id += "_chzn";
|
||||||
this.f_width = this.form_field_jq.width();
|
this.f_width = this.form_field_jq.width();
|
||||||
this.default_text = this.form_field_jq.attr('title') ? this.form_field_jq.attr('title') : this.default_text_default;
|
this.default_text = this.form_field_jq.attr('title') ? this.form_field_jq.attr('title') : this.default_text_default;
|
||||||
|
@ -686,7 +686,7 @@
|
||||||
};
|
};
|
||||||
Chosen.prototype.generate_random_id = function() {
|
Chosen.prototype.generate_random_id = function() {
|
||||||
var string;
|
var string;
|
||||||
string = 'sel' + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
|
string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
|
||||||
while ($("#" + string).length > 0) {
|
while ($("#" + string).length > 0) {
|
||||||
string += this.generate_random_char();
|
string += this.generate_random_char();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
};
|
};
|
||||||
Chosen.prototype.set_up_html = function() {
|
Chosen.prototype.set_up_html = function() {
|
||||||
var base_template, container_props, dd_top, dd_width, sf_width;
|
var base_template, container_props, dd_top, dd_width, sf_width;
|
||||||
this.container_id = this.form_field.identify() + "_chzn";
|
this.container_id = this.form_field.identify().replace('.', '_') + "_chzn";
|
||||||
this.f_width = this.form_field.getStyle("width") ? parseInt(this.form_field.getStyle("width"), 10) : this.form_field.getWidth();
|
this.f_width = this.form_field.getStyle("width") ? parseInt(this.form_field.getStyle("width"), 10) : this.form_field.getWidth();
|
||||||
container_props = {
|
container_props = {
|
||||||
'id': this.container_id,
|
'id': this.container_id,
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Chosen
|
||||||
@choices = 0
|
@choices = 0
|
||||||
|
|
||||||
set_up_html: ->
|
set_up_html: ->
|
||||||
@container_id = if @form_field.id.length then @form_field.id else this.generate_field_id()
|
@container_id = if @form_field.id.length then @form_field.id.replace('.', '_') else this.generate_field_id()
|
||||||
@container_id += "_chzn"
|
@container_id += "_chzn"
|
||||||
|
|
||||||
@f_width = @form_field_jq.width()
|
@f_width = @form_field_jq.width()
|
||||||
|
@ -585,7 +585,7 @@ class Chosen
|
||||||
new_id
|
new_id
|
||||||
|
|
||||||
generate_random_id: ->
|
generate_random_id: ->
|
||||||
string = 'sel' + this.generate_random_char() + this.generate_random_char() + this.generate_random_char()
|
string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char()
|
||||||
while $("#" + string).length > 0
|
while $("#" + string).length > 0
|
||||||
string += this.generate_random_char()
|
string += this.generate_random_char()
|
||||||
string
|
string
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Chosen
|
||||||
|
|
||||||
|
|
||||||
set_up_html: ->
|
set_up_html: ->
|
||||||
@container_id = @form_field.identify() + "_chzn"
|
@container_id = @form_field.identify().replace('.', '_') + "_chzn"
|
||||||
|
|
||||||
@f_width = if @form_field.getStyle("width") then parseInt @form_field.getStyle("width"), 10 else @form_field.getWidth()
|
@f_width = if @form_field.getStyle("width") then parseInt @form_field.getStyle("width"), 10 else @form_field.getWidth()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue