Sha256: 833e445a70e55d4b90f1de8aa55552bee1ee2d8bb0c81e82bb604c2846c9a786
Contents?: true
Size: 573 Bytes
Versions: 168
Compression:
Stored size: 573 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
168 entries across 168 versions & 1 rubygems