Skip to content

Commit

Permalink
support custom CSS classes in field render call
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 11, 2015
1 parent e296ee7 commit 3ee0437
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flask_pagedown/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ def __call__(self, field, **kwargs):
raise ValueError('One of show_input and show_preview must be true')
html = ''
if show_input:
class_ = kwargs.pop('class', '').split() + \
kwargs.pop('class_', '').split()
class_ += ['flask-pagedown-input']
html += pagedown_pre_html + super(PageDown, self).__call__(
field, id='flask-pagedown-' + field.name,
class_='flask-pagedown-input', **kwargs) + pagedown_post_html
class_=' '.join(class_), **kwargs) + pagedown_post_html
if show_preview:
html += preview_html % {'field': field.name}
return HTMLString(html)

0 comments on commit 3ee0437

Please sign in to comment.