Closed JonasUJ closed 4 years ago
I hope you don't mind me merging into submodule_refactor instead of version-2-0-0. This depends on stuff in there.
@JonasUJ I've already merged the submodule_refactor
branch into master
, so there is no need to target it with this PR.
Oh, then what is the version-2-0-0 branch for?
It was the branch used by #58
It was the branch used by #58
I've gone through and removed some of the merged branches now, to prevent further confusion.
I wish there was a more Pythonic way to write this
I feel you and I actually didn't mean for it to be like that. I saw that I redefined handle_event on every iteration, and without even thinking more about it moved it above the loop. If i had noticed the hide() and show() calls in the function, I wouldn't have expected this to work, but since it did I actually didn't notice this horror before you pointed it out.
I wish there was a more Pythonic way to write this
I feel you and I actually didn't mean for it to be like that. I saw that I redefined handle_event on every iteration, and without even thinking more about it moved it above the loop. If i had noticed the hide() and show() calls in the function, I wouldn't have expected this to work, but since it did I actually didn't notice this horror before you pointed it out.
So, callbacks will have access to this
, right, but would element
be available then inside this
? In that case, we could just define show
and hide
at the top, they can take element
as a parameter, and handle_event
can grab element
from this
and pass it into the function calls?
I'm not sure that will work but.. maybe?
EDIT: I'm concerned this would not work because you'd just get the final element in the iteration instead of the specific element that we were iterating when the callback was bound.
The sad thing is that if they just included this one CSS rule in Bulma, it would have almost the same behaviour and there would be no need for 40 lines of js
.dropdown:not(.is-hoverable) .dropdown-trigger:focus-within + .dropdown-menu {
display: block;
}
The sad thing is that if they just included this one CSS rule in Bulma, it would have almost the same behaviour and there would be no need for 40 lines of js
Bulma is quite receptive to pull requests - you could always open one to them and see what jgthms says?
Closes #27, which is one of the issues we needed to solve in #57.