Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-slider md-min but no md-max #3513

@OlsonDev

Description

@OlsonDev

Sliding an md-slider to the minimum value adds a class md-min which effectively whites out the thumb control (making it a circular outline). Why is there no md-max class when the md-slider is at the maximum value? I'm not sure what the style should be but it seems odd to have that inconsistency.

The code in question is:

/**
 * @param percent 0-1
 */
function setSliderPercent(percent) {
  activeTrack.css('width', (percent * 100) + '%');
  thumbContainer.css(
    'left',
    (percent * 100) + '%'
  );
  element.toggleClass('md-min', percent === 0);
}

While in there, how about:

var percentStr = (percent * 100) + '%';
activeTrack.css('width', percentStr);
thumbContainer.css('left', percentStr);

to DRY it out a little?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions