Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed widget to conform to tests

  • Loading branch information...
commit 4c444f94fcd6d2d33adc5b8a5b7ceb3f5445b880 1 parent 5641bea
@gregjurman gregjurman authored
View
0  tw2/dyntext/static/dyntext.css
No changes.
View
3  tw2/dyntext/templates/dyntext.mak
@@ -1,5 +1,2 @@
<%namespace name="tw" module="tw2.core.mako_util"/>
<span id="${w.attrs['id']}">${w.initial_text}</span>
-<script type="text/javascript">
- setupPollingDynText("${w.selector}", ${w.j('data_url')}, ${w.j('interval')});
-</script>
View
5 tw2/dyntext/widgets.py
@@ -4,6 +4,8 @@
from tw2.jquery import jquery_js
import json
+setup_call = twc.js_function('setupPollingDynText')
+
class DynamicTextWidget(twc.Widget):
template = "mako:tw2.dyntext.templates.dyntext"
@@ -29,4 +31,5 @@ def prepare(self):
super(DynamicTextWidget, self).prepare()
# put code here to run just before the widget is displayed
- self.selector = self.attrs['id'].replace(':', '\\\\:')
+ self.selector = self.attrs['id'].replace(':', '\\:')
+ self.add_call(setup_call(self.selector, self.data_url, self.interval))
Please sign in to comment.
Something went wrong with that request. Please try again.