Sha256: ce5b94e7e3c8a58f948337ad8d1d61d174308a72fabb3cd27b8b1b0afd0f38bc
Contents?: true
Size: 574 Bytes
Versions: 26
Compression:
Stored size: 574 Bytes
Contents
class window.Alchemy.CharCounter constructor: (field) -> @$field = $(field) @max_chars = @$field.data('alchemy-char-counter') @text = Alchemy._t('allowed_chars', @max_chars) @$display = $('<small class="alchemy-char-counter"/>') @$field.after(@$display) countChars.call(this) @$field.keyup => countChars.call(this) true countChars = -> char_length = @$field.val().length @$display.removeClass('too-long') @$display.text("#{char_length} #{@text}") if char_length > @max_chars @$display.addClass('too-long')
Version data entries
26 entries across 26 versions & 2 rubygems