Sha256: a24fe393101ffaeabcd215cc5674faa871dd7e324a15d029c88fd8063524ba28

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

/*
 * Requires jquery.responsiveText.js
*/


(function() {
  $(function() {
    return $('.responsive').not('table').each(function(index, object) {
      var $this, compression, max, min, scrollReset, scrollTime;

      compression = 10;
      min = 10;
      max = 200;
      scrollTime = 650;
      scrollReset = 200;
      compression = parseFloat($(this).attr('data-compression') || compression);
      min = parseFloat($(this).attr('data-min') || min);
      max = parseFloat($(this).attr('data-max') || max);
      $(object).responsiveText({
        compressor: compression,
        minSize: min,
        maxSize: max
      });
      $this = $(this);
      return $(this).hover((function() {
        var difference;

        difference = $this.get(0).scrollWidth - $this.width();
        if (difference > scrollTime) {
          scrollTime = difference;
        }
        if (difference > 0) {
          return $this.stop().animate({
            "text-indent": -difference
          }, scrollTime);
        }
      }), function() {
        return $this.stop().animate({
          "text-indent": 0
        }, scrollReset);
      });
    });
  });

}).call(this);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
groundworkcss-rails-0.2.12 vendor/assets/javascripts/groundworkcss/components/responsiveText.js
groundworkcss-rails-0.2.11 vendor/assets/javascripts/groundworkcss/components/responsiveText.js
groundworkcss-rails-0.2.10 vendor/assets/javascripts/groundworkcss/components/responsiveText.js