summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/details.js9
-rw-r--r--client/components/forms/inlinedform.js8
-rw-r--r--client/lib/escapeActions.js15
3 files changed, 12 insertions, 20 deletions
diff --git a/client/components/cards/details.js b/client/components/cards/details.js
index 05da2053..7c09ba81 100644
--- a/client/components/cards/details.js
+++ b/client/components/cards/details.js
@@ -40,11 +40,10 @@ BlazeComponent.extendComponent({
},
events: function() {
- // XXX We can't define this event directly in the event map below because we
- // miss ES6 object keys interpolation.
- var events = {};
- events[CSSEvents.animationend + ' .js-card-details'] = function() {
- this.isLoaded.set(true);
+ var events = {
+ [CSSEvents.animationend + ' .js-card-details']: function() {
+ this.isLoaded.set(true);
+ }
};
return [_.extend(events, {
diff --git a/client/components/forms/inlinedform.js b/client/components/forms/inlinedform.js
index 2988738c..09c75ce1 100644
--- a/client/components/forms/inlinedform.js
+++ b/client/components/forms/inlinedform.js
@@ -70,12 +70,10 @@ BlazeComponent.extendComponent({
// Close the inlined form when after its submission
submit: function() {
- var self = this;
- // XXX Swith to an arrow function here when we'll have ES6
if (this.currentData().autoclose !== false) {
- Tracker.afterFlush(function() {
- self.close();
- self.callFirstWith(self, 'resetCache');
+ Tracker.afterFlush(() => {
+ this.close();
+ this.callFirstWith(this, 'resetCache');
});
}
}
diff --git a/client/lib/escapeActions.js b/client/lib/escapeActions.js
index 3d08e2e3..1173dc46 100644
--- a/client/lib/escapeActions.js
+++ b/client/lib/escapeActions.js
@@ -17,25 +17,20 @@ EscapeActions = {
'sidebarView'
],
- register: function(label, action, condition, options) {
- condition = condition || function() { return true; };
- options = options || {};
-
- // XXX Rewrite this with ES6: .push({ priority, condition, action })
+ register: function(label, action, condition = () => true, options = {}) {
var priority = this.hierarchy.indexOf(label);
if (priority === -1) {
throw Error('You must define the label in the EscapeActions hierarchy');
}
this._actions.push({
- priority: priority,
- condition: condition,
- action: action,
+ priority,
+ condition,
+ action,
noClickEscapeOn: options.noClickEscapeOn,
enabledOnClick: !! options.enabledOnClick
});
- // XXX Rewrite this with ES6: => function
- this._actions = _.sortBy(this._actions, function(a) { return a.priority; });
+ this._actions = _.sortBy(this._actions, (a) => { return a.priority; });
},
executeLowest: function() {