Skip to content

Append allText to selected Text in button #37

@patrick-abc

Description

@patrick-abc

When defined a allText option, then select the options, it would be nice to add the allText before.

Proposal to change the updateButtonContents function.

Change this:

if (selected.length == 0) {
  this.$button.text( this.settings['noneText'] );
} else if ( (selected.length === options.length) && this.settings['allText']) {
  this.$button.text( this.settings['allText'] );
} else {
  this.$button.text( selected.join(', ') );
}

To this:

if (selected.length == 0) {
  this.$button.text( this.settings['noneText'] );
} else if ( (selected.length === options.length) && this.settings['allText']) {
  this.$button.text( this.settings['allText'] );
} else if (this.settings['noneText']){
  this.$button.text( this.settings['noneText'] + ': ' + selected.join(', ') );
} else {
  this.$button.text( selected.join(', ') );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions