summaryrefslogtreecommitdiffstats
path: root/client/components/lists/main.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-05-23 22:23:27 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-05-23 22:23:27 +0200
commit40b605f7d897db6eb2697be1748741221378e71c (patch)
tree43377344c6a2b1f25746d0567a39fb1446a6a91a /client/components/lists/main.js
parent9c2a3213eb47956aaf116209d070ccac5dcddca6 (diff)
downloadwekan-40b605f7d897db6eb2697be1748741221378e71c.tar.gz
wekan-40b605f7d897db6eb2697be1748741221378e71c.tar.bz2
wekan-40b605f7d897db6eb2697be1748741221378e71c.zip
Hide the card composer link while a card is being dragged
Diffstat (limited to 'client/components/lists/main.js')
-rw-r--r--client/components/lists/main.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/client/components/lists/main.js b/client/components/lists/main.js
index 748b94d5..78aad17c 100644
--- a/client/components/lists/main.js
+++ b/client/components/lists/main.js
@@ -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();