Permalink
Browse files

Moved the text setter call into it's own function so it's easily

callable.
  • Loading branch information...
1 parent 72ed163 commit 8c5924de96d87e3b0c2052c3030970d02cf1bb0e @gregjurman gregjurman committed Feb 25, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 tw2/dyntext/static/dyntext.js
@@ -1,9 +1,10 @@
-function setupPollingDynText(text_widget, data_url, interval)
-{
+function setDynamicText(text_widget, new_value) {
+ $("#"+text_widget).text(new_value);
+}
+
+function setupPollingDynText(text_widget, data_url, interval) {
$.getJSON(data_url, function(data) {
- var new_text = data.text;
-
- $("#"+text_widget).text(new_text);
+ setDynamicText(text_widget, data.text);
});
setTimeout( function () {

0 comments on commit 8c5924d

Please sign in to comment.