Permalink
Browse files

Added wrap param to set what tag the text should be wrapped with.

  • Loading branch information...
1 parent ed011be commit dc2ce03fc8b8fdccc58c0f3c5fdbe227b265108d @gregjurman gregjurman committed Mar 6, 2012
Showing with 9 additions and 3 deletions.
  1. +1 −1 tw2/dyntext/templates/dyntext.mak
  2. +8 −2 tw2/dyntext/widgets.py
@@ -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}>
@@ -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()

0 comments on commit dc2ce03

Please sign in to comment.