Giter Club home page Giter Club logo

jscolor's People

Contributors

callumacrae avatar

Stargazers

Adrian Moisa avatar

Watchers

 avatar James Cloos avatar

jscolor's Issues

Don't find input fields, only on the bower installation.

I noticed that the jscolor I get when using bower install ("bower install JSColor --save") does not work on the following element:

<p>Color: <input id="background-color" class="jscolor {onFineChange:'updateBackground(this)'}" value="6A9AAB"></p>

Which should be valid + works with the minified version I got from the site (the zip you can download from http://jscolor.com/)

I debugged it and saw that in this line in bind():

if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {

It fails on the condition:

e[i].className.match(matchClass)

So I compared this part with the minified version I had from the site (I edited the names etc in the minified so it will be easier to compare):

var matchClass =    new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');   // from bower
var r =             new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)','i');  // minified

as you can see the regex is slightly different which I guess is the problem.

tl;dr

The bower version of jscolor have a wrong regex that don't identify valid input fields that are shown as examples in the site and are successfully identified by the (probably older) minified zip version.

Awesome lib btw ๐Ÿ‘

Thanks!

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.