Skip to content

Instantly share code, notes, and snippets.

@greggy
Created February 27, 2014 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggy/9250351 to your computer and use it in GitHub Desktop.
Save greggy/9250351 to your computer and use it in GitHub Desktop.
if (data.result == 'ok'){
for (var i = 0; i < self.type_results().length; i++) {
var el = self.type_results()[i];
if (el.id == id) {
self.type_results.remove(el);
el.approved = true;
self.type_results.splice(i, 0, el);
break; // we found our id so can break the loop
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment