Permalink
Browse files

Fixed widget to conform to tests

  • Loading branch information...
1 parent 5641bea commit 4c444f94fcd6d2d33adc5b8a5b7ceb3f5445b880 @gregjurman gregjurman committed Feb 20, 2012
Showing with 4 additions and 4 deletions.
  1. 0 tw2/dyntext/static/dyntext.css
  2. +0 −3 tw2/dyntext/templates/dyntext.mak
  3. +4 −1 tw2/dyntext/widgets.py
No changes.
@@ -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
@@ -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))

0 comments on commit 4c444f9

Please sign in to comment.