Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: chrome/browser/resources/md_extensions/animation_helper.js

Issue 2960293002: MD Extensions: Convert classes to use ES6 class syntax. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_extensions/manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_extensions/animation_helper.js
diff --git a/chrome/browser/resources/md_extensions/animation_helper.js b/chrome/browser/resources/md_extensions/animation_helper.js
index a429f18475ab3d355c9cf18107222f16184efcfe..00483b37d418e35a3cac3ccb64407cac70c567eb 100644
--- a/chrome/browser/resources/md_extensions/animation_helper.js
+++ b/chrome/browser/resources/md_extensions/animation_helper.js
@@ -22,24 +22,25 @@ cr.define('extensions', function() {
* A helper object for setting entry/exit animations. Polymer's support of
* this is pretty limited, since it doesn't allow for things like specifying
* hero properties or nodes.
- * @param {!HTMLElement} element The parent element to set the animations on.
- * This will be used as the page in to/fromPage.
- * @param {?HTMLElement} node The node to use for scaling and fading
- * animations.
- * @constructor
*/
- function AnimationHelper(element, node) {
- this.element_ = element;
- this.node_ = node;
- element.animationConfig = {};
- }
+ class AnimationHelper {
+ /**
+ * @param {!HTMLElement} element The parent element to set the animations
+ * on. This will be used as the page in to/fromPage.
+ * @param {?HTMLElement} node The node to use for scaling and fading
+ * animations.
+ */
+ constructor(element, node) {
+ this.element_ = element;
+ this.node_ = node;
+ element.animationConfig = {};
+ }
- AnimationHelper.prototype = {
/**
* Set the entry animation for the element.
* @param {!Array<extensions.Animation>} animations
*/
- setEntryAnimations: function(animations) {
+ setEntryAnimations(animations) {
var configs = [];
for (let animation of animations) {
switch (animation) {
@@ -56,13 +57,13 @@ cr.define('extensions', function() {
}
}
this.element_.animationConfig.entry = configs;
- },
+ }
/**
* Set the exit animation for the element.
* @param {!Array<extensions.Animation>} animations
*/
- setExitAnimations: function(animations) {
+ setExitAnimations(animations) {
var configs = [];
for (let animation of animations) {
switch (animation) {
@@ -88,8 +89,8 @@ cr.define('extensions', function() {
}
}
this.element_.animationConfig.exit = configs;
- },
- };
+ }
+ }
return {AnimationHelper: AnimationHelper};
});
« no previous file with comments | « no previous file | chrome/browser/resources/md_extensions/manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698