summaryrefslogtreecommitdiffstats
path: root/client/components/cards/cardTime.js
diff options
context:
space:
mode:
authorJustin Reynolds <justinr1234@gmail.com>2019-06-28 12:52:09 -0500
committerJustin Reynolds <justinr1234@gmail.com>2019-06-28 12:56:51 -0500
commit3eb4d2c341b712268bd321173909e0a7b19a88c9 (patch)
tree25a8fcb088f3984e72a5bd3ded9e6a45376e0693 /client/components/cards/cardTime.js
parenta0a482aa8efb3255a523de4524c8e09453d5571f (diff)
downloadwekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.gz
wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.bz2
wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.zip
Prettier & eslint project style update
Diffstat (limited to 'client/components/cards/cardTime.js')
-rw-r--r--client/components/cards/cardTime.js62
1 files changed, 37 insertions, 25 deletions
diff --git a/client/components/cards/cardTime.js b/client/components/cards/cardTime.js
index 80b7fc84..d8a41aaa 100644
--- a/client/components/cards/cardTime.js
+++ b/client/components/cards/cardTime.js
@@ -20,29 +20,31 @@ BlazeComponent.extendComponent({
this.card.setSpentTime(null);
},
events() {
- return [{
- //TODO : need checking this portion
- 'submit .edit-time'(evt) {
- evt.preventDefault();
+ return [
+ {
+ //TODO : need checking this portion
+ 'submit .edit-time'(evt) {
+ evt.preventDefault();
- const spentTime = parseFloat(evt.target.time.value);
- const isOvertime = this.card.getIsOvertime();
+ const spentTime = parseFloat(evt.target.time.value);
+ const isOvertime = this.card.getIsOvertime();
- if (spentTime >= 0) {
- this.storeTime(spentTime, isOvertime);
+ if (spentTime >= 0) {
+ this.storeTime(spentTime, isOvertime);
+ Popup.close();
+ } else {
+ this.error.set('invalid-time');
+ evt.target.time.focus();
+ }
+ },
+ 'click .js-delete-time'(evt) {
+ evt.preventDefault();
+ this.deleteTime();
Popup.close();
- } else {
- this.error.set('invalid-time');
- evt.target.time.focus();
- }
+ },
+ 'click a.js-toggle-overtime': this.toggleOvertime,
},
- 'click .js-delete-time'(evt) {
- evt.preventDefault();
- this.deleteTime();
- Popup.close();
- },
- 'click a.js-toggle-overtime': this.toggleOvertime,
- }];
+ ];
},
}).register('editCardSpentTimePopup');
@@ -56,23 +58,33 @@ BlazeComponent.extendComponent({
},
showTitle() {
if (this.data().getIsOvertime()) {
- return `${TAPi18n.__('overtime')} ${this.data().getSpentTime()} ${TAPi18n.__('hours')}`;
+ return `${TAPi18n.__(
+ 'overtime',
+ )} ${this.data().getSpentTime()} ${TAPi18n.__('hours')}`;
} else {
- return `${TAPi18n.__('card-spent')} ${this.data().getSpentTime()} ${TAPi18n.__('hours')}`;
+ return `${TAPi18n.__(
+ 'card-spent',
+ )} ${this.data().getSpentTime()} ${TAPi18n.__('hours')}`;
}
},
showTime() {
return this.data().getSpentTime();
},
events() {
- return [{
- 'click .js-edit-time': Popup.open('editCardSpentTime'),
- }];
+ return [
+ {
+ 'click .js-edit-time': Popup.open('editCardSpentTime'),
+ },
+ ];
},
}).register('cardSpentTime');
Template.timeBadge.helpers({
canModifyCard() {
- return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ return (
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
+ );
},
});