summaryrefslogtreecommitdiffstats
path: root/client/lib/popup.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-10-22 04:02:12 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-10-22 18:13:12 +0200
commitaa974aa54ab6e5b7db7450206d12b44ffb3a0306 (patch)
treeb501ee16fa630e19b95d99ffc3984e30301e096a /client/lib/popup.js
parentc6b12dc5ada1b37d759796fefe0dbc5b327f130c (diff)
downloadwekan-aa974aa54ab6e5b7db7450206d12b44ffb3a0306.tar.gz
wekan-aa974aa54ab6e5b7db7450206d12b44ffb3a0306.tar.bz2
wekan-aa974aa54ab6e5b7db7450206d12b44ffb3a0306.zip
Prefer ES5 methods over underscore utilities
Since 07cc454 (ie the switch to Meteor 1.2) we includes the `es5-shim` polyfill to support methods like `Array.prototype.forEach` in a consistent way across all supported browsers (IE8+). MDG recently released a blog post recommending the use of these native methods instead of underscore [0]. We know follow this recommendation. This commit also favor some ES6 features (argument defaults, destructing assignment) in places where we didn’t use them. [0]: http://info.meteor.com/blog/es2015-get-started
Diffstat (limited to 'client/lib/popup.js')
-rw-r--r--client/lib/popup.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/lib/popup.js b/client/lib/popup.js
index 3c39af29..7418d938 100644
--- a/client/lib/popup.js
+++ b/client/lib/popup.js
@@ -91,7 +91,7 @@ window.Popup = new class {
if (!self.isOpen()) {
self.current = Blaze.renderWithData(self.template, () => {
self._dep.depend();
- return _.extend(self._getTopStack(), { stack: self._stack });
+ return { ...self._getTopStack(), stack: self._stack };
}, document.body);
} else {
@@ -191,7 +191,7 @@ window.Popup = new class {
// We close a potential opened popup on any left click on the document, or go
// one step back by pressing escape.
const escapeActions = ['back', 'close'];
-_.each(escapeActions, (actionName) => {
+escapeActions.forEach((actionName) => {
EscapeActions.register(`popup-${actionName}`,
() => Popup[actionName](),
() => Popup.isOpen(),