mirror of
https://github.com/wekan/wekan.git
synced 2026-02-02 22:51:47 +01:00
Merge branch 'devel' into minicard-editor
Conflicts: client/components/lists/listBody.js
This commit is contained in:
commit
2b134ff7a9
54 changed files with 1027 additions and 310 deletions
|
|
@ -7,7 +7,7 @@ BlazeComponent.extendComponent({
|
|||
|
||||
// Proxy
|
||||
openForm(options) {
|
||||
this.componentChildren('listBody')[0].openForm(options);
|
||||
this.childrenComponents('listBody')[0].openForm(options);
|
||||
},
|
||||
|
||||
onCreated() {
|
||||
|
|
@ -25,7 +25,7 @@ BlazeComponent.extendComponent({
|
|||
if (!Meteor.user() || !Meteor.user().isBoardMember())
|
||||
return;
|
||||
|
||||
const boardComponent = this.componentParent();
|
||||
const boardComponent = this.parentComponent();
|
||||
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
|
||||
const $cards = this.$('.js-minicards');
|
||||
$cards.sortable({
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ BlazeComponent.extendComponent({
|
|||
options = options || {};
|
||||
options.position = options.position || 'top';
|
||||
|
||||
const forms = this.componentChildren('inlinedForm');
|
||||
let form = _.find(forms, (component) => {
|
||||
const forms = this.childrenComponents('inlinedForm');
|
||||
let form = forms.find((component) => {
|
||||
return component.data().position === options.position;
|
||||
});
|
||||
if (!form && forms.length > 0) {
|
||||
|
|
@ -26,8 +26,8 @@ BlazeComponent.extendComponent({
|
|||
const firstCardDom = this.find('.js-minicard:first');
|
||||
const lastCardDom = this.find('.js-minicard:last');
|
||||
const textarea = $(evt.currentTarget).find('textarea');
|
||||
let title = textarea.val();
|
||||
const position = Blaze.getData(evt.currentTarget).position;
|
||||
const position = this.currentData().position;
|
||||
let title = textarea.val().trim();
|
||||
let sortIndex;
|
||||
if (position === 'top') {
|
||||
sortIndex = Utils.calculateIndex(null, firstCardDom).base;
|
||||
|
|
@ -62,7 +62,7 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
});
|
||||
|
||||
if ($.trim(title)) {
|
||||
if (title) {
|
||||
const _id = Cards.insert({
|
||||
title,
|
||||
listId: this.data()._id,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ template(name="listActionPopup")
|
|||
li: a.js-archive-cards {{_ 'list-archive-cards'}}
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li: a.js-import-card {{_ 'import-card'}}
|
||||
li: a.js-close-list {{_ 'archive-list'}}
|
||||
|
||||
template(name="listMoveCardsPopup")
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ BlazeComponent.extendComponent({
|
|||
|
||||
editTitle(evt) {
|
||||
evt.preventDefault();
|
||||
const newTitle = this.componentChildren('inlinedForm')[0].getValue();
|
||||
const newTitle = this.childrenComponents('inlinedForm')[0].getValue().trim();
|
||||
const list = this.currentData();
|
||||
if ($.trim(newTitle)) {
|
||||
list.rename(newTitle);
|
||||
if (newTitle) {
|
||||
list.rename(newTitle.trim());
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -33,6 +33,7 @@ Template.listActionPopup.events({
|
|||
MultiSelection.add(cardIds);
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-import-card': Popup.open('listImportCard'),
|
||||
'click .js-move-cards': Popup.open('listMoveCards'),
|
||||
'click .js-archive-cards': Popup.afterConfirm('listArchiveCards', function() {
|
||||
this.allCards().forEach((card) => {
|
||||
|
|
@ -40,6 +41,7 @@ Template.listActionPopup.events({
|
|||
});
|
||||
Popup.close();
|
||||
}),
|
||||
|
||||
'click .js-close-list'(evt) {
|
||||
evt.preventDefault();
|
||||
this.archive();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue