diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2016-01-01 10:45:07 +0100 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2016-01-01 10:45:07 +0100 |
commit | 9fa291763485c08830bb8fd2108f9ad0c36aea83 (patch) | |
tree | 41523370b57afaf764ec4bf8fd63f2689fb5a532 /client/components | |
parent | 9c013d3233056638de1e46e632ccffe82f3aca70 (diff) | |
parent | 23ca733afd99d270b1d6645c43549eabd9475e7a (diff) | |
download | wekan-9fa291763485c08830bb8fd2108f9ad0c36aea83.tar.gz wekan-9fa291763485c08830bb8fd2108f9ad0c36aea83.tar.bz2 wekan-9fa291763485c08830bb8fd2108f9ad0c36aea83.zip |
Merge pull request #463 from alayek/autosize-card-title
Autosize card title
Fixes #394
Diffstat (limited to 'client/components')
-rw-r--r-- | client/components/cards/cardDetails.jade | 12 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 13 |
2 files changed, 21 insertions, 4 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index 0282aa77..3f2ae34a 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -2,10 +2,7 @@ template(name="cardDetails") section.card-details.js-card-details.js-perfect-scrollbar: .card-details-canvas .card-details-header +inlinedForm(classNames="js-card-details-title") - input.full-line(type="text" value=title autofocus) - .edit-controls.clearfix - button.primary.confirm(type="submit") {{_ 'save'}} - a.fa.fa-times-thin.js-close-inlined-form + +editCardTitleForm else a.fa.fa-times-thin.close-card-details.js-close-card-details if currentUser.isBoardMember @@ -77,6 +74,13 @@ template(name="cardDetails") if isLoaded.get +activities(card=this mode="card") +template(name="editCardTitleForm") + textarea.js-edit-card-title(rows='1' autofocus) + = title + .edit-controls.clearfix + button.primary.confirm.js-submit-edit-card-title-form(type="submit") {{_ 'save'}} + a.fa.fa-times-thin.js-close-inlined-form + template(name="cardDetailsActionsPopup") ul.pop-over-list li: a.js-members {{_ 'card-edit-members'}} diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index ea1363b5..bfe9f755 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -141,6 +141,19 @@ Template.cardDetailsActionsPopup.events({ 'click .js-more': Popup.open('cardMore'), }); +Template.editCardTitleForm.onRendered(function() { + autosize(this.$('.js-edit-card-title')); +}); + +Template.editCardTitleForm.events({ + 'keydown .js-edit-card-title'(evt) { + // If enter key was pressed, submit the data + if (evt.keyCode === 13) { + $('.js-submit-edit-card-title-form').click(); + } + }, +}); + Template.moveCardPopup.events({ 'click .js-select-list'() { // XXX We should *not* get the currentCard from the global state, but |