-
-
Notifications
You must be signed in to change notification settings - Fork 497
Changing the way to set label to increase customizability #355
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
Comments
I like the idea because this is closer to the angular logic. The main issue that I can see though is that today you can display html strings from the translate function and this won't work with your solution: https://jsfiddle.net/meu7ap6n/ About your 3 points:
|
@ValentinH Thanks for the quick reply.
Actually that's what I tried first in order to achieve something like 2nd example in fiddle. One simple solution is using ng-bind-html in templates instead of
That's good to hear :)
Sorry didn't understand this. The problem I wanted to say here was that I can still click the
Actually after some consideration, I think we better have translate option either way. If a user just need a slight change on label text, it'd be too much to force them to make whole another template file. |
This is exactly what I was going to say.
Oh ok, didn't understand then. Maybe adding a ng-show could do the job. What I was thinking for my first answer was a slider that uses the Anyway, could you submit a PR with what you have so far so we can discuss on the way to implement it? ;) |
Ah okay I'll take care of that as well.
Yes I'll send it, just wanted to make sure before actually going deeper. Thank you :D |
@ValentinH Here's the fiddle and code change |
About the position, it's weird and I don't understand why it doesn't work for now. About using |
It was because the changes on scope variable doesn't immediately reflect on DOM but after the
Here's the alternative, added If it's looking good, I'll update README and send a pull request. |
About the watching, it looks heavy in my opinion. Maybe adding a $timeout call before computing the dimension/position can do the job. However, my main concern is not to slow down the current version of this library so I want to be sure that we get the same performance as before. About the Anyway, could you still submit the PR so I can checkout the code on my computer and really understand what are the consequences of such a change? |
I actually tied this first, but it broke the labels as I drag handle. Could you see if it works?
By this change, now we don't have
|
I got the idea behind I'll try to have a look to find a way to replace the $watch logic later today ;) |
Hello there, I have a custom directive that modifies my labels for each pointer using xeditable, and it seems that this is attempting to put different labels. I would LOVE for a solution to be posted so that we can target specific labels. Alternately, would you be able to modify the rz-bubble spans above the pointers so that the left and right spans can be targeted more closely? Thanks! |
When you say, targeted for the bubbles, do you mean by CSS ? |
I would like to replace the value in the slider with another directive, in this case x-editable, which can manually overwrite the value. Is that possible? |
OK So I think that the #358 pull request corresponds to what you need. |
So I need to insert my directive directly into the template in order to call it? |
Yes but first you need the PR to be merged on master and released. @Liooo Do you think you can finish it soon? |
@ValentinH |
I'm not your boss! :) Just wanted to check if we can expect it soon so that @mm-wang can use it. Do it when you want/can ;) |
Just kidding bro.lol yea it's been in my head, guess this is a good timing, will finish it today. |
😂 |
PR has been merged. I'm away from computer this weekend so I'll bump a new version on Monday. ;) |
@ValentinH ok thanks! |
Hey @ValentinH, is the version up yet? Just curious so that I can start implementing. Thank you! |
Released under 5.3.0 ;) |
Are the values or the other options of the slider available under the template? I'm looking to create a directive that checks for the value under the label against the floor and ceiling of the slider |
No they are not, they are internal to the directive. I dont understand what you are trying to do actually. |
Let me try to explain... I am trying to use another directive called angular-xeditable in order to allow a user to click on a label and adjust the value of the slider. I have an editable text field for both the minimum and maximum values of the slider. What you are seeing is the number 100 clicked, with a new user input value of 120. If that person clicks on the check, then the value is updated. When a user clicks on either the minimum or maximum text number, they can then edit it. I am trying to put this field in place of the actual label. In order to do this, I am checking the value of the input against the maximum and minimum values of the slider, and currently manually changing the value of the slider. Since the label for the slider is now accessible, I can place my directive there, but I'm not sure how to get access to the actual value in order to check it. Make sense? |
OK Now I understand what you want to do, but I don't know how I would do that. It's quite complicated... |
I'm wondering if there is a way to modify this in the translate function? I think what I'm hoping for is a level of two way binding in the template between the values and options in the slider to the nested directive. When the template URL is taken into the directive, can it have a two way binding so that the elements in the slider can be accessible from there? |
I think that you use case is really specific and should be handled by a modified version of the slider directive. Indeed, you will get better performance and will be able to do all the tweaks you want to the default behavior. |
Yes, you're probably right. Trying to get a bit too deep in here now. Thanks for all the help though! |
Problem
The library doesn't have capability to customize label using angular directive.
Solution
Exposing variables that store label strings on the template's scope, rather than setting with
$.html()
Here's the quick simple code change.
and here's the jsfiddle.
i roughly looked through the code, and noticed i still need to fix the following things, in addition to the change above.
display:hide
rather thanopacity:0
to hide combo label or model/high label as they switch, in case for example there's ng-click attached on either of the element (written here)translate
option in the future if we're doing this)Question
what do you guys think of this idea and the solution?
The text was updated successfully, but these errors were encountered: