Compare commits
3 Commits
340a3a2da3
...
b28d2f098b
Author | SHA1 | Date |
---|---|---|
buggyj | b28d2f098b | |
Matt Lauber | a081e58273 | |
buggyj | f9cec3a7d2 |
|
@ -283,7 +283,7 @@ exports.httpRequest = function(options) {
|
|||
// Set up the state change handler
|
||||
request.onreadystatechange = function() {
|
||||
if(this.readyState === 4) {
|
||||
if(this.status === 200 || this.status === 201 || this.status === 204) {
|
||||
if(this.status >= 200 && this.status < 300) {
|
||||
// Success!
|
||||
options.callback(null,this[returnProp],this);
|
||||
return;
|
||||
|
|
|
@ -122,8 +122,17 @@ SelectWidget.prototype.setSelectValue = function() {
|
|||
value = value === undefined ? "" : value;
|
||||
var select = this.getSelectDomNode();
|
||||
var values = Array.isArray(value) ? value : $tw.utils.parseStringArray(value);
|
||||
var child;
|
||||
for(var i=0; i < select.children.length; i++){
|
||||
select.children[i].selected = values.indexOf(select.children[i].value) !== -1
|
||||
child=select.children[i];
|
||||
if (child.children.length === 0){
|
||||
child.selected = values.indexOf(child.value) !== -1
|
||||
} else {
|
||||
// grouped options
|
||||
for(var y=0; y < child.children.length; y++){
|
||||
child.children[y].selected = values.indexOf(child.children[y].value) !== -1
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var domNode = this.getSelectDomNode();
|
||||
|
|
Loading…
Reference in New Issue