Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Commit

Permalink
milestoning correct leveraging of search controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Bull committed Jan 29, 2013
1 parent 4aaa30e commit e9ff0c8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
6 changes: 3 additions & 3 deletions index.html
Expand Up @@ -8,10 +8,10 @@

<head>
<meta charset="utf-8">
<title>Ember.js Reference Application</title>
<title>The Ember.js (Musical) Reference Application</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="description" content="An easy way for you to get started with Ember.js">
<meta name="author" content="Anthony Bull">

<!-- Le styles -->
Expand Down Expand Up @@ -59,7 +59,7 @@
<ul class="nav nav-list">
<li class="nav-header">Stations</li>
{{#each controller}}
<li class="">{{#linkTo stations.tracks this}}{{this.name}}{{/linkTo}}</li>
<li {{ bindAttr class="view.isActive" }}>{{#linkTo stations.tracks this}}{{this.name}}{{/linkTo}}</li>
{{else}}
<p>
You don't have any stations.
Expand Down
28 changes: 16 additions & 12 deletions js/app.js
Expand Up @@ -27,12 +27,9 @@ App.TracksRoute = Ember.Route.extend({
}
});

//App.searchController = Ember.Object.create({
//searchText: '',
//search: function(){
//console.log('search for %@'.fmt( this.get('searchText') ));
//}
//});
App.StationsIndexView = Ember.View.extend({
isActive: true
});

App.StationsTracksPlayingView = Ember.View.extend({
scBaseUrl: 'https://w.soundcloud.com/player/',
Expand All @@ -42,16 +39,23 @@ App.StationsTracksPlayingView = Ember.View.extend({
}.property()
});

App.SearchController = Ember.Object.create({
search: function(query){
alert(query);
//console.log('search for %@'.fmt( this.get('searchText') ));
}
});

App.SearchView = Ember.TextField.extend({
valueBinding: 'App.SearchController.model',
didInsertElement: function() {
this.$().focus();
},
insertNewline: function() {
App.SearchController.setCurrent
var value = this.get('value');
console.log(value);
//debugger;
//if (value) {
//App.productsController.search(value);
//}
if (value) {
App.get('SearchController').search(value);
}
}
});

Expand Down

0 comments on commit e9ff0c8

Please sign in to comment.