<cr-slider> to wrap a <paper-slider>, providing common logic around mapping from slider indices to real values.
I'm still skeptical that "providing common logic" should be handled by "wrap a <paper-thing>"
I tried it two ways because http://i.imgur.com/LpAf5re.png https://codereview.chromium.org/1967913002/#ps1 https://codereview.chromium.org/1967913002/#ps80001 It's not easy when the amount of logic is non-trivial, but still less than the amount of data and UI to wrap/behaviorize/bind.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d326605487da452867181c1fe0dc7c6580b0d714 commit d326605487da452867181c1fe0dc7c6580b0d714 Author: michaelpg <michaelpg@chromium.org> Date: Thu Jun 02 21:43:23 2016 Material WebUI: cr-slider element for intelligent range mapping Most sliders don't correspond 1:1 with a range of values. For instance, we curate a range of valid values for pointer sensitivity, then map these to a linear slider. <cr-slider> takes an array of values corresponding to slider indices, and binds the value of the <paper-slider> it wraps to the host element's property. This simplifies the logic that was duplicated in keyboard.html and appearance_fonts_page.html. It also fixes a rare edge case when a pref value updates while the slider is being dragged. BUG= 611949 TEST=CrElementsBrowserTest.CrElements CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/1967913002 Cr-Commit-Position: refs/heads/master@{#397517} [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/browser/resources/settings/device_page/compiled_resources2.gyp [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/browser/resources/settings/device_page/keyboard.html [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/browser/resources/settings/device_page/keyboard.js [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/browser/resources/settings/settings_shared_css.html [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/chrome_tests.gypi [add] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js [add] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/test/data/webui/cr_elements/cr_slider_tests.js [add] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js [delete] https://crrev.com/a8ea9274d69b2209ea4e4f996069274cd08a1a24/chrome/test/data/webui/cr_elements_browsertest.js [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/chrome/test/data/webui/settings/device_page_tests.js [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/ui/webui/resources/cr_elements/compiled_resources2.gyp [add] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/ui/webui/resources/cr_elements/cr_slider/compiled_resources2.gyp [add] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/ui/webui/resources/cr_elements/cr_slider/cr_slider.html [add] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/ui/webui/resources/cr_elements/cr_slider/cr_slider.js [modify] https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714/ui/webui/resources/cr_elements_resources.grdp
this exists now, but note issue 598879
Comment 1 by dbeam@chromium.org
, May 17 2016