Permalink
Browse files

added the ability to play and stop the music via the amplifier

  • Loading branch information...
1 parent 7839982 commit 1b231cb3a651f4dce0407066a84ea84d47e1e65e Nathaniel Escribano committed Feb 12, 2012
Showing with 24 additions and 2 deletions.
  1. +8 −0 src/assets/app.css
  2. +16 −2 src/views/outputView.js
View
8 src/assets/app.css
@@ -34,3 +34,11 @@ body {
.deselected {
opacity: .6;
}
+
+#amplifier {
+ opacity: .2;
+}
+
+#amplifier.selected {
+ opacity: 1;
+}
View
18 src/views/outputView.js
@@ -3,9 +3,23 @@ Maw.OutputView = Ember.View.extend({
classNames: ['output'],
- attributeBindings: ['src', 'title'],
+ classNameBindings: ['selected'],
+
+ attributeBindings: ['src', 'title', 'elementId'],
src:'assets/images/amplifier.png',
- title:'output'
+ title:'output',
+ elementId: 'amplifier',
+
+ selected: false,
+
+ click: function() {
+ this.set('selected', !this.get('selected'));
+ if (this.get('selected')) {
+ play();
+ } else {
+ stop();
+ }
+ }
});

0 comments on commit 1b231cb

Please sign in to comment.