caiogondim / blooming-menu.js Goto Github PK
View Code? Open in Web Editor NEW:cherry_blossom: AwesomeMenu made with CSS
Home Page: https://caiogondim.github.io/blooming-menu.js/
License: MIT License
:cherry_blossom: AwesomeMenu made with CSS
Home Page: https://caiogondim.github.io/blooming-menu.js/
License: MIT License
I like the project, but, for many of us, an example showing an actual click function working for the blooming buttons would be helpful since just having the blooming menu with no function for the buttons makes it not easily usable in a project.
Calling removeEventListener
with one parameter raises an exception in Chrome (but not Safari).
The following code raises a TypeError
in Chrome but nothing in Safari:
document.querySelector('body').removeEventListener('foo')
It seems that the calls to removeEventListener
required a named function, otherwise they throw an error. This occurs in the selectItem
call:
var btnWrappers = document.querySelector('.' + self.props.CSSClassPrefix + ITEM_BTN_WRAPPER_CSS_CLASS)
btnWrappers.addEventListener(animationEndEventName(), function () {
self.close()
self.props.elements.items.forEach(function (item) {
item.style.display = 'none'
})
document
.querySelector('.' + self.props.CSSClassPrefix + ITEM_BTN_WRAPPER_CSS_CLASS)
.removeEventListener(animationEndEventName()) // <-- Requires 2 params
})
There are calls to removeEventListener
via instance.remove()
too:
function unbindEventListeners (self) {
self.props.elements.main.removeEventListener('click')
self.props.elements.main.removeEventListener('touchstart')
}
These also throw errors in Chrome. This can be reproduced simply with:
var menu;
menu = new BloomingMenu({ itemsNum: 3 });
menu.render();
menu.remove();
I can work on a PR for this but just want to make sure I'm not missing something obvious about how the library or removeEventListener
works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.