mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Hide the card composer link while a card is being dragged
This commit is contained in:
parent
9c2a3213eb
commit
40b605f7d8
5 changed files with 43 additions and 13 deletions
|
|
@ -3,11 +3,19 @@ BlazeComponent.extendComponent({
|
|||
return 'list';
|
||||
},
|
||||
|
||||
// Proxy
|
||||
// Proxies
|
||||
openForm: function(options) {
|
||||
this.componentChildren('listBody')[0].openForm(options);
|
||||
},
|
||||
|
||||
showNewCardForm: function(value) {
|
||||
this.componentChildren('listBody')[0].showNewCardForm(value);
|
||||
},
|
||||
|
||||
onCreated: function() {
|
||||
this.newCardFormIsVisible = new ReactiveVar(true);
|
||||
},
|
||||
|
||||
// XXX The jQuery UI sortable plugin is far from ideal here. First we include
|
||||
// all jQuery components but only use one. Second, it modifies the DOM itself,
|
||||
// resulting in Blaze abandoning reactive update of the nodes that have been
|
||||
|
|
@ -16,6 +24,7 @@ BlazeComponent.extendComponent({
|
|||
// the drag&drop code ourselves?
|
||||
onRendered: function() {
|
||||
if (Meteor.user().isBoardMember()) {
|
||||
var boardComponent = this.componentParent();
|
||||
var $cards = this.$('.js-minicards');
|
||||
$cards.sortable({
|
||||
connectWith: '.js-minicards',
|
||||
|
|
@ -27,6 +36,7 @@ BlazeComponent.extendComponent({
|
|||
start: function(event, ui) {
|
||||
$('.minicard.placeholder').height(ui.item.height());
|
||||
Popup.close();
|
||||
boardComponent.showNewCardForms(false);
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
// To attribute the new index number, we need to get the dom element
|
||||
|
|
@ -43,6 +53,7 @@ BlazeComponent.extendComponent({
|
|||
sort: sort
|
||||
}
|
||||
});
|
||||
boardComponent.showNewCardForms(true);
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue