Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pinLabel property. #167

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paper-slider",
"version": "1.0.12",
"version": "1.0.13",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't update bower.json/version number with this PR - we will do that separately and publish a release separately.

"description": "A material design-style slider",
"license": "http://polymer.github.io/LICENSE.txt",
"authors": "The Polymer Authors",
Expand Down
16 changes: 15 additions & 1 deletion paper-slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
on-up="_resetKnob"
on-track="_onTrack"
on-transitionend="_knobTransitionEnd">
<div class="slider-knob-inner" value$="[[immediateValue]]"></div>
<div class="slider-knob-inner" value$="[[_getPinLabel(pinLabel, immediateValue)]]"></div>
</div>
</div>

Expand Down Expand Up @@ -388,6 +388,16 @@
notify: true
},

/**
* If set, a this text will be used in the pin instead of just the numeric
* number. Use if you need to format the label in any way.
*/
pinLabel: {
type: String,
value: "",
notify: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value and notify property are unnecessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed them now.

},

/**
* The number that represents the current secondary progress.
*/
Expand Down Expand Up @@ -704,6 +714,10 @@
event.stopPropagation();
},

_getPinLabel: function(pinLabel, value) {
return pinLabel ? pinLabel : value;
},

// create the element ripple inside the `sliderKnob`
_createRipple: function() {
this._rippleContainer = this.$.sliderKnob;
Expand Down