Permalink
Browse files

use the views 'ui' to DRY the element selectors

  • Loading branch information...
1 parent d677783 commit 13aa49a95acc904e75597941430e7fe9e91b1a22 @evdb evdb committed Dec 25, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 public/js/app.js
View
@@ -70,10 +70,14 @@
"submit form": "doSearch"
},
+ ui: {
+ isbnInput: "input[name=isbn]"
+ },
+
doSearch: function (e) {
e.preventDefault();
- var isbn = this.$("input[name=isbn]").val();
+ var isbn = this.ui.isbnInput.val();
appRouter.navigate("isbn/" + isbn, {trigger: true});
}

0 comments on commit 13aa49a

Please sign in to comment.