Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Hide stuff when it changes.

  • Loading branch information...
commit 9a1f0f545ce35a94b083d7f363aab765f877f979 1 parent ea069a3
@dustin dustin authored
View
4 _attachments/js/readme.js
@@ -10,7 +10,9 @@ function rm_init_update_links(app) {
data: 'new_state=' + encodeURIComponent(parts[0]),
dataType: "json",
complete: function(res) {
- console.log("Result", res);
+ if (res.responseText === 'change') {
+ $('#item-' + parts[1]).hide('fast');
+ }
}});
return false;
View
2  evently/items/_changes/mustache.html
@@ -1,7 +1,7 @@
<h1>Recent Messages</h1>
<ul id="items">
{{#items}}
- <li>
+ <li id="item-{{_id}}">
<div class="header">
<img src="{{rm_favicon}}" alt="favicon" />
[<a href="#" class="statechange" id="done-{{_id}}"
View
2  templates/item.html
@@ -1,4 +1,4 @@
-<li>
+<li id='item-{{_id}}'>
<div class="header">
<img src="{{rm_favicon}}" alt="favicon" />
[<a href="#" class="statechange" id="done-{{_id}}"
View
3  updates/set_state.js
@@ -1,4 +1,5 @@
function(doc, req) {
+ var old_state = doc['rm_state'];
doc['rm_state'] = req.form.new_state;
- return [doc, 'State set to ' + doc['rm_state']];
+ return [doc, (old_state === req.form.new_state) ? "nochange" : "change"];
}
Please sign in to comment.
Something went wrong with that request. Please try again.