-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Rework oh-knob and oh-slider, fixes #1003 #1012
Conversation
Job #118: Bundle Size — 10.44MB (~-0.01%).Changed metrics (3/8)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a lot of trial and error to make these controls work reasonably well, but obviously it was still far from perfect, and while I'm very careful to avoid regressions, I can't seem to fault the reworked implementation after initial testing. So I'd say it does seem a superior one indeed. The additonal parameters to control the debouncing is also a welcome addition.
Just a few remarks below:
@@ -0,0 +1,58 @@ | |||
<script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention is to have mixins in regular .js file, not .vue files, and thus this <script>
tag, and the closing tag, are unnecessary.
Please rename the file to slide-mixin.js
and remove those tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, not sure why I did that 🤔. Will correct, of course!
widget: OhSliderDefinition, | ||
mounted () { | ||
delete this.config.value | ||
|
||
// f7-range inside of masonry can get rendered faulty, as the masonry changes its breakpoint layout after being rendered | ||
// re-calculate the range slider after masonry is updated | ||
setTimeout(() => { | ||
this.$refs.rangeslider.f7Range.calcSize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly related to this PR, but I just noticed the following error appears quite frequently referencing this line:
oh-slider.vue?08ef:24 Uncaught TypeError: Cannot read property 'f7Range' of undefined
at eval (oh-slider.vue?08ef:24)
Perhaps this PR is a good opportunity to solve it as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. But as it seems, I can't reproduce that. I could just add an if ...f7Range...
, but I'd prefer to test it. Can you provide a short YAML and your actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, added it blindly now. Please test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, we'll know soon enough if there are major regressions with this new implementation, but I don't any so far!
bundles/org.openhab.ui/web/src/assets/definitions/widgets/system/knob.js
Show resolved
Hide resolved
Fix oh-slider issue Signed-off-by: Hubert Nusser <[email protected]>
I reworked oh-knob in order to fix #1003, which resulted following:
updateInterval
anddelayStateDisplay
, with defaults being 500ms and 2000ms, added as advanced configuration to both componentsoh-slider
is practically the same thing, just displayed differently, I adjusted that to behave the same way (and because I wanted to be able to 'live'-dim my lamps 😉)Let me know what you think.