Giter VIP home page Giter VIP logo

clear-menu's People

Contributors

bebaps avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

slopesweb

clear-menu's Issues

Auto height on panel when revealing from the bottom

Having an auto height on the panel and reveling the panel from the bottom exposes empty space from the panel to the bottom of the viewport. Obviously not an issue if the panel is 100% height. Will need to make adjustments for this so that the panel can still be revealed from the bottom of the viewport regardless of how tall it is.

The same is true for setting an auto width and revealing from the right.

Add classes

This was originally created to not use any classes on the menu itself, but after some thought it would be good to use JS to apply some classes. These do not actually need to have any styles applied to them, but can be there to help with targeting during state changes

Use Object.assign instead of $.extends

Favor for the JavaScript standard over relying on the jQuery specific implementation. Less of an issue since this is a jQuery plugin, but something to consider.

Replace Switch with Pulling from Map

When adding the class for reveal you can replace the switch statement since you already have a map declared.

      switch (settings.reveal) {
        case 'bottom':
          $(settings.panel).addClass(classes.bottom);
          break;
        case 'left':
          $(settings.panel).addClass(classes.left);
          break;
        case 'right':
          $(settings.panel).addClass(classes.right);
          break;
        case 'fade':
          $(settings.panel).addClass(classes.fade);
          break;
        default:
          $(settings.panel).addClass(classes.top);
          break;
      }

can easily be re-written as

   $(settings.panel).addClass(classes[settings.reveal] || classes.top)

Reduces the lines of code and get rid of the often problematic break; requirement between cases.

https://github.com/bebaps/clear-menu/blob/master/src/clearmenu.js#L32

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.