mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-04 15:43:28 +00:00
lazily set the value if the items aren't rendered yet and re-enable setting the allocation in the add window
This commit is contained in:
parent
310b4bad31
commit
31304d3397
@ -85,7 +85,6 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||||||
xtype: 'radiogroup',
|
xtype: 'radiogroup',
|
||||||
columns: 1,
|
columns: 1,
|
||||||
vertical: true,
|
vertical: true,
|
||||||
disabled: true,
|
|
||||||
labelSeparator: '',
|
labelSeparator: '',
|
||||||
items: [{
|
items: [{
|
||||||
name: 'compact_allocation',
|
name: 'compact_allocation',
|
||||||
|
@ -37,6 +37,11 @@ Ext.override(Ext.form.RadioGroup, {
|
|||||||
this.items.each(function(i) {
|
this.items.each(function(i) {
|
||||||
this.relayEvents(i, ['check']);
|
this.relayEvents(i, ['check']);
|
||||||
}, this);
|
}, this);
|
||||||
|
if (this.lazyValue) {
|
||||||
|
this.setValue(this.value);
|
||||||
|
delete this.value;
|
||||||
|
delete this.lazyValue;
|
||||||
|
}
|
||||||
Ext.form.RadioGroup.superclass.afterRender.call(this)
|
Ext.form.RadioGroup.superclass.afterRender.call(this)
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -45,17 +50,15 @@ Ext.override(Ext.form.RadioGroup, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getValue: function() {
|
getValue: function() {
|
||||||
//var v;
|
|
||||||
return this.items.first().getGroupValue();
|
return this.items.first().getGroupValue();
|
||||||
//this.items.each(function(item) {
|
|
||||||
// v = item.getRawValue();
|
|
||||||
// return !item.getValue();
|
|
||||||
//});
|
|
||||||
//return v;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setValue: function(v) {
|
setValue: function(v) {
|
||||||
if (!this.items.each) return;
|
if (!this.items.each) {
|
||||||
|
this.value = v;
|
||||||
|
this.lazyValue = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.items.each(function(item) {
|
this.items.each(function(item) {
|
||||||
if (item.rendered) {
|
if (item.rendered) {
|
||||||
var checked = (item.el.getValue() == String(v));
|
var checked = (item.el.getValue() == String(v));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user