Fix popup title

Add element title modification
This commit is contained in:
Andrés Manelli 2019-02-27 21:32:28 +01:00
parent abb7108321
commit 888e1ad5d3
4 changed files with 11 additions and 3 deletions

View file

@ -90,6 +90,10 @@ template(name="linkCardPopup")
input.primary.confirm.js-done(type="button" value="{{_ 'link'}}") input.primary.confirm.js-done(type="button" value="{{_ 'link'}}")
template(name="searchElementPopup") template(name="searchElementPopup")
form
label
| {{_ 'title'}}
input.js-element-title(type="text" placeholder="{{_ 'title'}}" autofocus required)
unless isTemplateSearch unless isTemplateSearch
label {{_ 'boards'}}: label {{_ 'boards'}}:
.link-board-wrapper .link-board-wrapper

View file

@ -616,7 +616,11 @@ BlazeComponent.extendComponent({
}, },
'click .js-minicard'(evt) { 'click .js-minicard'(evt) {
// 0. Common // 0. Common
const title = $('.js-element-title').val().trim();
if (!title)
return;
const element = Blaze.getData(evt.currentTarget); const element = Blaze.getData(evt.currentTarget);
element.title = title;
let _id = ''; let _id = '';
if (!this.isTemplateSearch || this.isCardTemplateSearch) { if (!this.isTemplateSearch || this.isCardTemplateSearch) {
// Card insertion // Card insertion
@ -648,6 +652,7 @@ BlazeComponent.extendComponent({
board = Boards.findOne(element.linkedId); board = Boards.findOne(element.linkedId);
board.sort = Boards.find({archived: false}).count(); board.sort = Boards.find({archived: false}).count();
board.type = 'board'; board.type = 'board';
board.title = element.title;
delete board.slug; delete board.slug;
_id = board.copy(); _id = board.copy();
} }

View file

@ -207,7 +207,7 @@
"confirm-checklist-delete-dialog": "Are you sure you want to delete checklist?", "confirm-checklist-delete-dialog": "Are you sure you want to delete checklist?",
"copy-card-link-to-clipboard": "Copy card link to clipboard", "copy-card-link-to-clipboard": "Copy card link to clipboard",
"linkCardPopup-title": "Link Card", "linkCardPopup-title": "Link Card",
"searchCardPopup-title": "Search Card", "searchElementPopup-title": "Search",
"copyCardPopup-title": "Copy Card", "copyCardPopup-title": "Copy Card",
"copyChecklistToManyCardsPopup-title": "Copy Checklist Template to Many Cards", "copyChecklistToManyCardsPopup-title": "Copy Checklist Template to Many Cards",
"copyChecklistToManyCardsPopup-instructions": "Destination Card Titles and Descriptions in this JSON format", "copyChecklistToManyCardsPopup-instructions": "Destination Card Titles and Descriptions in this JSON format",

View file

@ -326,8 +326,7 @@ Boards.helpers({
archived: false, archived: false,
}).forEach((swimlane) => { }).forEach((swimlane) => {
swimlane.type = 'swimlane'; swimlane.type = 'swimlane';
swimlane.boardId = _id; swimlane.copy(_id);
swimlane.copy(oldId);
}); });
}, },
/** /**