Giter VIP home page Giter VIP logo

blooming-menu.js's People

Contributors

benfogel avatar bitdeli-chef avatar caiogondim avatar wesvetter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blooming-menu.js's Issues

Example for click handlers, links for blooming buttons

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.

calls to removeEventListener raise errors in Chrome

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.