-
Notifications
You must be signed in to change notification settings - Fork 133
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
Menus #33
Menus #33
Conversation
Hi Alexander, Awesome! I definitely want to merge this when it's done! About native code: We can't have native code in elm-mdl, because then we don't get to publish it as a package. But this is not a showstopper, I thin, because you can read Javascript properties off the DOM in pure Elm: you construct a I'm doing a similar thing in the Ripple animation implementation. Since you need to call Thanks! Søren |
I opened an issue (#34) for this, just to signal to other's that the Menu component is already being worked on. |
Hi! Thanks for your advice. It made me question my assumption that DOM traversal in
However,
I reckon that PS. I forgot to include |
Hi Alexander, Very cool! If you can decode
couldn't you then traverse
for I'm really keen to have the menu component not rely on native because elm-mdl with a native component won't be allowed in the package repository. About getting your At any rate, I don't want to wait for any of those things: I need Elm to be useful to me now. So as an interrim solution, can I propose you construct a Looking forward to see more stuff monday! Søren |
Hello, I just wanted to let you know that I uploaded some bogus Oracle.elm file. Oops. That line that you quoted, in particular |
Ok. I'all try to take a look at decoding childNodes it tonight or tomorrow. tir. 19. apr. 2016 kl. 01.10 skrev Alexander Foremny <
|
Yes, it is still work in progress. I will refactor this PR to use Native as we have discussed. I will manage to in the next couple of days. Yesterday something came up. :) |
Ok, cool :) I found a way to decode Was that the last obstacle to getting rid of Native? |
Wow! That's pretty neat! That should solve the need for Native. I will test. :) |
Excellent—looking forward to seeing the results!
|
This is a working implementation. It differs from mdl-menus in at least the following aspects:
I did not really get the component model yet, so I removed types and functions related to it. Can we merge this? In that case I could make it a single commit and open a new PR. Demo: https://aforemny.github.io/elm-mdl/#/menus edit: I think I understand the component parts a bit better. I'll try to update it tonight. |
{ alignment : Style | ||
, ripple : Bool | ||
, items : Dict Int Ripple.Model | ||
, open : Maybe Bool -- |
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.
I'm unsure about the two fields open : Maybe Bool
(why Maybe?) and closing : Bool
. Looking at the later code, I can't help wondering if it'd be better to encode the possible states directly:
type AnimationState
= Idle
| Opening
| Open
| Closing
Would this make the update function clearer?
|
||
decode : Decoder Oracle | ||
decode = | ||
object5 |
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.
I think you can simply do object5 Oracle
, where Oracle
is an auto-generated version of the function you define in the next 7 lines.
Altogether: Excellent! Very impressive, especially the Oracle module. I'm very happy you did this! As you can see, I made some comments, some stylistic, some semantic. I'm hoping you'll take a look and act on the ones that make sense to you. You mentioned that:
I don't see that in the demo? However, on Mac OS in both Chrome and Safari, the menu doesn't open on click, only on keyboard input (enter, space).
I see that. I wonder why not?
Ok.
Sure! I'd love it if you'd take a look at some of my other comments first, but otherwise, sure!
Ok, cool. If you can make it work, that's be great; otherwise, I can do it later. |
Thanks a lot for your detailed feedback! I'm agreeing with all of it, and will update accordingly. :) |
Excellent :) |
I changed the This implementation does not use the Because all actions carry I found a fix for the Chrome bug by setting "pointer-events: none" on the menu's Regarding the fact that the menu does not close when clicked outside: mdl binds to the document's PS. |
As I said above: Very neat! About Opening/is-animating: at least on Chrome, when I try the Demo, the About hiding the Geometry part of Actions. I think exposing public actions Thank you for the Chrome fix—it works nicely now :) About outside clicks: I don't know of a good way to register clicks with Again, excellent work! |
Thank you for your detailed comments! I updated the demo to use the component model, added back the I merged this myself in feabf9f. |
Hi, I made an attempt at implementing menus! :)
It is still work-in-progress, but I wanted to share it. Any chance of getting this merged when it's done?
Note that I am using native code to query a few javascript properties of the menu element on button press. I think I cannot do this in pure Elm, can I?
Demo: https://aforemny.github.io/elm-mdl/#/menus