|
@@ -3,11 +3,19 @@ BlazeComponent.extendComponent({
|
|
return 'list';
|
|
return 'list';
|
|
},
|
|
},
|
|
|
|
|
|
- // Proxy
|
|
|
|
|
|
+ // Proxies
|
|
openForm: function(options) {
|
|
openForm: function(options) {
|
|
this.componentChildren('listBody')[0].openForm(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
|
|
// 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,
|
|
// 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
|
|
// resulting in Blaze abandoning reactive update of the nodes that have been
|
|
@@ -16,6 +24,7 @@ BlazeComponent.extendComponent({
|
|
// the drag&drop code ourselves?
|
|
// the drag&drop code ourselves?
|
|
onRendered: function() {
|
|
onRendered: function() {
|
|
if (Meteor.user().isBoardMember()) {
|
|
if (Meteor.user().isBoardMember()) {
|
|
|
|
+ var boardComponent = this.componentParent();
|
|
var $cards = this.$('.js-minicards');
|
|
var $cards = this.$('.js-minicards');
|
|
$cards.sortable({
|
|
$cards.sortable({
|
|
connectWith: '.js-minicards',
|
|
connectWith: '.js-minicards',
|
|
@@ -27,6 +36,7 @@ BlazeComponent.extendComponent({
|
|
start: function(event, ui) {
|
|
start: function(event, ui) {
|
|
$('.minicard.placeholder').height(ui.item.height());
|
|
$('.minicard.placeholder').height(ui.item.height());
|
|
Popup.close();
|
|
Popup.close();
|
|
|
|
+ boardComponent.showNewCardForms(false);
|
|
},
|
|
},
|
|
stop: function(event, ui) {
|
|
stop: function(event, ui) {
|
|
// To attribute the new index number, we need to get the dom element
|
|
// To attribute the new index number, we need to get the dom element
|
|
@@ -43,6 +53,7 @@ BlazeComponent.extendComponent({
|
|
sort: sort
|
|
sort: sort
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ boardComponent.showNewCardForms(true);
|
|
}
|
|
}
|
|
}).disableSelection();
|
|
}).disableSelection();
|
|
|
|
|