cms/app-client/app/components/toolbar-component.js
author Chloe Laisne <chloe.laisne@gmail.com>
Mon, 04 Jul 2016 12:26:19 +0200
changeset 218 38e1a1446319
parent 217 989b9c36b849
child 242 523ca6e73353
permissions -rw-r--r--
Player toolbar actions and display logic
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
217
989b9c36b849 Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff changeset
     1
import Ember from 'ember';
989b9c36b849 Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff changeset
     2
989b9c36b849 Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff changeset
     3
export default Ember.Component.extend({
989b9c36b849 Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff changeset
     4
218
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
     5
	player: Ember.inject.service(),
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
     6
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
     7
	classNames: ['toolbar-component'],
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
     8
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
     9
	actions: {
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    10
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    11
		display: function(element) {
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    12
			if(this.get('player').get('window') !== element) {
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    13
				this.get('player').set('window', element);
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    14
			} else {
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    15
				this.get('player').set('window', '');
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    16
			}
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    17
		}
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    18
38e1a1446319 Player toolbar actions and display logic
Chloe Laisne <chloe.laisne@gmail.com>
parents: 217
diff changeset
    19
	}
217
989b9c36b849 Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff changeset
    20
989b9c36b849 Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff changeset
    21
});