Index: ui/file_manager/audio_player/elements/control_panel.js |
diff --git a/ui/file_manager/audio_player/elements/control_panel.js b/ui/file_manager/audio_player/elements/control_panel.js |
index 94c6db1d615cf9605dec15bc243e4da7669c4084..877f26eeafccb9c8047c25b641434d9ff1514f92 100644 |
--- a/ui/file_manager/audio_player/elements/control_panel.js |
+++ b/ui/file_manager/audio_player/elements/control_panel.js |
@@ -34,15 +34,26 @@ |
return ~~(time / 60000) + ':' + ('0' + ~~(time / 1000 % 60)).slice(-2); |
} |
- Polymer('control-panel', { |
+ /** |
+ * @constructor |
+ * @extends {PolymerElement} |
+ */ |
+ var ControlPanelElement = function() {}; |
+ |
+ ControlPanelElement.prototype = { |
/** |
* Initializes an element. This method is called automatically when the |
* element is ready. |
*/ |
ready: function() { |
var onFocusoutBound = this.onVolumeControllerFocusout_.bind(this); |
- this.$.volumeSlider.addEventListener('focusout', onFocusoutBound); |
- this.$.volumeButton.addEventListener('focusout', onFocusoutBound); |
+ |
+ this.volumeSlider = this.$.volumeSlider; |
+ this.volumeButton = this.$.volumeButton; |
+ this.volumeContainer = this.$.volumeContainer; |
+ |
+ this.volumeSlider.addEventListener('focusout', onFocusoutBound); |
+ this.volumeButton.addEventListener('focusout', onFocusoutBound); |
}, |
/** |
@@ -57,7 +68,7 @@ |
* @param {AudioPlayerModel} newValue New Value. |
*/ |
modelChanged: function(oldValue, newValue) { |
- this.$.volumeSlider.model = newValue; |
+ this.volumeSlider.model = newValue; |
}, |
/** |
@@ -136,7 +147,7 @@ |
/** |
* Invoked the volume button is clicked. |
- * @type {Event} event The event. |
+ * @param {!Event} event The event. |
*/ |
volumeButtonClick: function(event) { |
this.showVolumeController_(this.volumeSliderShown); |
@@ -145,15 +156,15 @@ |
/** |
* Invoked when the focus goes out of the volume elements. |
- * @param {FocusEvent} event The focusout event. |
+ * @param {!FocusEvent} event The focusout event. |
* @private |
*/ |
onVolumeControllerFocusout_: function(event) { |
if (this.volumeSliderShown) { |
// If the focus goes out of the volume, hide the volume control. |
if (!event.relatedTarget || |
- (event.relatedTarget !== this.$.volumeButton && |
- event.relatedTarget !== this.$.volumeSlider)) { |
+ (event.relatedTarget !== this.volumeButton && |
+ event.relatedTarget !== this.volumeSlider)) { |
this.showVolumeController_(false); |
this.volumeSliderShown = false; |
} |
@@ -168,10 +179,12 @@ |
showVolumeController_: function(show) { |
if (show) { |
matchBottomLine(this.$.volumeContainer, this.$.volumeButton); |
- this.$.volumeContainer.style.visibility = 'visible'; |
+ this.volumeContainer.style.visibility = 'visible'; |
} else { |
- this.$.volumeContainer.style.visibility = 'hidden'; |
+ this.volumeContainer.style.visibility = 'hidden'; |
} |
}, |
- }); |
+ }; |
+ |
+ Polymer('control-panel', ControlPanelElement.prototype); |
})(); // Anonymous closure |