mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-30 19:44:48 +00:00
The stopPropagation() call was too eager, as this blocked legitimate clicks on the links in the 'more' dropdown. Yes, I know javascript:void(0) is evil, but it's less evil than href="#" in that it doesn't have side effects. And if the design calls for an element that has the same styling and interactions as an `<a>` element but just happens to trigger an in-page action rather than navigating to a new URL, I don't see why I should jump through hoops undoing the native style of an alternative element like `<button>` to achieve something that's perfectly simple to do the 'evil' way, and as far as I'm aware has no negative effects other than to cause HTML purists to roll their eyes. SO THERE.
This commit is contained in:
parent
a6dcd8e06b
commit
d7f4dab1fa
2 changed files with 1 additions and 3 deletions
|
|
@ -427,8 +427,6 @@ wagtail = (function(document, window, wagtail) {
|
|||
|
||||
_closeDropDown: function(e) {
|
||||
this.state.isOpen = false;
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var el = this.el;
|
||||
var $parent = this.$parent;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div {{ self.attrs }} class="c-dropdown {% if is_parent %}t-inverted{% else %}t-default{% endif %}" data-dropdown>
|
||||
<a href="#" title="{{ title }}" class="c-dropdown__button u-btn-current">
|
||||
<a href="javascript:void(0)" title="{{ title }}" class="c-dropdown__button u-btn-current">
|
||||
{{ label }}
|
||||
<div data-dropdown-toggle class="o-icon c-dropdown__toggle [ icon icon-arrow-down ]"></div>
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Reference in a new issue