Compare commits
1 commit
master
...
js_style_f
Author | SHA1 | Date | |
---|---|---|---|
8f63638e12 |
|
@ -55,7 +55,7 @@
|
|||
disabled: group_disabled === true ? group_disabled : option.disabled,
|
||||
group_array_index: group_position,
|
||||
classes: option.className,
|
||||
style: option.style.cssText
|
||||
style: this.readAttr(option, "style")
|
||||
});
|
||||
} else {
|
||||
this.parsed.push({
|
||||
|
@ -67,6 +67,14 @@
|
|||
return this.options_index += 1;
|
||||
}
|
||||
};
|
||||
SelectParser.prototype.readAttr = function(ele, attr) {
|
||||
var res;
|
||||
res = ele.getAttribute != null ? ele.getAttribute(attr) : ele[attr];
|
||||
if (res) {
|
||||
res.toLowerCase();
|
||||
}
|
||||
return res;
|
||||
};
|
||||
return SelectParser;
|
||||
})();
|
||||
SelectParser.select_to_array = function(select) {
|
||||
|
@ -153,7 +161,7 @@
|
|||
if (option.classes !== "") {
|
||||
classes.push(option.classes);
|
||||
}
|
||||
style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
|
||||
style = (option.style != null) && option.style !== "" ? " style=\"" + option.style + ";\"" : "";
|
||||
return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
|
||||
} else {
|
||||
return "";
|
||||
|
|
2
chosen/chosen.jquery.min.js
vendored
2
chosen/chosen.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -55,7 +55,7 @@
|
|||
disabled: group_disabled === true ? group_disabled : option.disabled,
|
||||
group_array_index: group_position,
|
||||
classes: option.className,
|
||||
style: option.style.cssText
|
||||
style: this.readAttr(option, "style")
|
||||
});
|
||||
} else {
|
||||
this.parsed.push({
|
||||
|
@ -67,6 +67,14 @@
|
|||
return this.options_index += 1;
|
||||
}
|
||||
};
|
||||
SelectParser.prototype.readAttr = function(ele, attr) {
|
||||
var res;
|
||||
res = ele.getAttribute != null ? ele.getAttribute(attr) : ele[attr];
|
||||
if (res) {
|
||||
res.toLowerCase();
|
||||
}
|
||||
return res;
|
||||
};
|
||||
return SelectParser;
|
||||
})();
|
||||
SelectParser.select_to_array = function(select) {
|
||||
|
@ -153,7 +161,7 @@
|
|||
if (option.classes !== "") {
|
||||
classes.push(option.classes);
|
||||
}
|
||||
style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
|
||||
style = (option.style != null) && option.style !== "" ? " style=\"" + option.style + ";\"" : "";
|
||||
return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
|
||||
} else {
|
||||
return "";
|
||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -52,7 +52,7 @@ class AbstractChosen
|
|||
classes.push "group-option" if option.group_array_index?
|
||||
classes.push option.classes if option.classes != ""
|
||||
|
||||
style = if option.style.cssText != "" then " style=\"#{option.style}\"" else ""
|
||||
style = if option.style? && option.style != "" then " style=\"#{option.style};\"" else ""
|
||||
|
||||
'<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"'+style+'>' + option.html + '</li>'
|
||||
else
|
||||
|
|
|
@ -35,7 +35,7 @@ class SelectParser
|
|||
disabled: if group_disabled is true then group_disabled else option.disabled
|
||||
group_array_index: group_position
|
||||
classes: option.className
|
||||
style: option.style.cssText
|
||||
style: this.readAttr option, "style"
|
||||
else
|
||||
@parsed.push
|
||||
array_index: @parsed.length
|
||||
|
@ -43,6 +43,11 @@ class SelectParser
|
|||
empty: true
|
||||
@options_index += 1
|
||||
|
||||
readAttr: (ele, attr) ->
|
||||
res = if ele.getAttribute? then ele.getAttribute(attr) else ele[attr]
|
||||
res.toLowerCase() if res
|
||||
return res
|
||||
|
||||
SelectParser.select_to_array = (select) ->
|
||||
parser = new SelectParser()
|
||||
parser.add_node( child ) for child in select.childNodes
|
||||
|
|
Loading…
Reference in a new issue