Code Monkey home page Code Monkey logo

Comments (13)

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

It's something I've been tossing up. Cheers for raising the issue.

from ng-fittext.js.

jab avatar jab commented on June 14, 2024

Cheers for considering! What's the downside, just having to implement debounce? Looks like lodash's is ~100 lines, but we could implement it less generically in fewer.

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

Yeah, it was just a matter of including it as succinctly as possible...

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

Added a minified version of Underscore's debounce function.

from ng-fittext.js.

jab avatar jab commented on June 14, 2024

Nice :)

from ng-fittext.js.

lanterndev avatar lanterndev commented on June 14, 2024

Just an idea: Think it's worth making debounce an option, so users can opt out of it, or supply a different delay?

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

Unsure how to accomplish settings which will effect all directives (without adding an additional wrapper) - unless you simply mean making the setting more accessible within the file via a var up top?

from ng-fittext.js.

lanterndev avatar lanterndev commented on June 14, 2024

Does https://github.com/angular-ui/bootstrap/blob/master/src/pagination/pagination.js provide a good example of how to offer directive configuration? (Search that as well as the docs at http://angular-ui.github.io/bootstrap/ for "paginationConfig").

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

Don't really understand a config that gets blown away whenever an update to the module comes along... Nor does it make sense that these settings are attributes for each directive. Needs to be independent and global - which seems to suggest setting attributes on a parent directive/controller

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

@Skivvies added the config for you, looking into how this can be extended (in a similar fashion to jQuery plugins)

from ng-fittext.js.

lanterndev avatar lanterndev commented on June 14, 2024

Thanks @patrickmarabeas. I'm more familiar with the Angular ecosystem than jQuery. I'll keep an eye out for what you do to see what you mean.

Worth updating the README with an example of overriding the default debounce?

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

@Skivvies see https://github.com/patrickmarabeas/jQuery-FontSpy.js

$('.bannerTextChecked').fontSpy({
    onLoad: 'hideMe',
    onFail: 'fontFail anotherClass'
});

extends:
(https://github.com/patrickmarabeas/jQuery-FontSpy.js/blob/master/jQuery-FontSpy.js#L24)

var defaults = {
    font: $element.css("font-family"),
    onLoad: '',
    onFail: '',
    testFont: 'Comic Sans MS',
    testString: 'QW@HhsXJ',
    delay: 50,
    timeOut: 2500
};

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 14, 2024

@Skivvies It has been implemented if you're interested. README has been updated as well : )

from ng-fittext.js.

Related Issues (20)

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.