Skip to content

Commit

Permalink
Added wrap param to set what tag the text should be wrapped with.
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Jurman committed Mar 6, 2012
1 parent ed011be commit dc2ce03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tw2/dyntext/templates/dyntext.mak
@@ -1,2 +1,2 @@
<%namespace name="tw" module="tw2.core.mako_util"/>
<span id="${w.attrs['id']}">${w.initial_text}</span>
<${w.wrap} id="${w.attrs['id']}">${w.initial_text}</${w.wrap}>
10 changes: 8 additions & 2 deletions tw2/dyntext/widgets.py
Expand Up @@ -8,11 +8,17 @@ class DynamicTextWidget(twc.Widget):
template = "mako:tw2.dyntext.templates.dyntext"

resources = [
jquery_js,
twc.JSLink(modname=__name__, filename='static/dyntext.js'),
jquery_js
]

initial_text = twc.Param('Initial text to place in the widget', default='')
initial_text = twc.Param(
description='Initial text to place in the widget. Default: None',
default='')

wrap = twc.Param(
description = 'Tag to wrap the widget with. Default: span',
default='span')

def prepare(self):
super(DynamicTextWidget, self).prepare()
Expand Down

0 comments on commit dc2ce03

Please sign in to comment.