mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Optimize logic for first value and button all selection
This commit is contained in:
@@ -172,12 +172,13 @@ var View = Backbone.View.extend({
|
||||
/** Synchronizes the model value with the actually selected field value */
|
||||
_changeValue: function() {
|
||||
this._setValue( this.model.get( 'value' ) );
|
||||
if ( this.model.get( 'searchable' ) ) {
|
||||
if ( this._getValue() === null && !this.model.get( 'multiple' ) && !this.model.get( 'optional' ) ) {
|
||||
this._setValue( this.first() );
|
||||
if ( this.model.get( 'multiple' ) ) {
|
||||
if ( this.all_button ) {
|
||||
var value = this._getValue();
|
||||
this.all_button.value( $.isArray( value ) ? value.length : 0, this.length() );
|
||||
}
|
||||
var value = this._getValue();
|
||||
this.all_button && this.all_button.value( $.isArray( value ) ? value.length : 0, this.length() );
|
||||
} else if ( this._getValue() === null && !this.model.get( 'optional' ) ) {
|
||||
this._setValue( this.first() );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user