Code Monkey home page Code Monkey logo

Comments (4)

vfreitas- avatar vfreitas- commented on September 27, 2024 1

How would this icon option work? Allow you to define a class or html for the icon? e.g a font-awesome class or even a SVG ?

About the close method, for a simple solution I can think about something like this:
src/index.js line 80
$el.close = closeMessage

Works just fine http://codepen.io/vfreitas-/pen/zZXewx

What do you think? Feel free to make a PR if you want, contributions are welcome 😄

from growl-alert.

vfreitas- avatar vfreitas- commented on September 27, 2024 1

I've released the version 1.0.0, and now it returns an object containing the element and the close method. So you can just do:

var gr = growl()
gr.close()
gr.$element

About the icon option, I'll try to add it this weekend.

from growl-alert.

xxRockOnxx avatar xxRockOnxx commented on September 27, 2024

Wow, so glad this is still active.

Yes, either SVG or font-awesome will do. Better if something like:

Option Type Default
icon String/Boolean false

Now if it's a string, it'll be a class containing the icon you want OR the SVG. That's for the default growl.

If it's growl.error() and the others... add a default icon.

Hmm, I'm not sure tho if it's good to extend DOM element. I'll stick with click for a while.

from growl-alert.

xxRockOnxx avatar xxRockOnxx commented on September 27, 2024

That's what I actually tried but thought it'll be a breaking change so I stepped back. Thanks!

from growl-alert.

Related Issues (3)

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.