Fix new list form

Fixes #157.
This commit is contained in:
Maxime Quandalle 2015-05-14 15:21:48 +02:00
parent 22b8b6ab20
commit 018bb343b5
6 changed files with 65 additions and 62 deletions

View file

@ -87,8 +87,8 @@ observe-sequence@1.0.6
ongoworks:speakingurl@1.1.0 ongoworks:speakingurl@1.1.0
ordered-dict@1.0.3 ordered-dict@1.0.3
peerlibrary:assert@0.2.5 peerlibrary:assert@0.2.5
peerlibrary:base-component@0.8.0 peerlibrary:base-component@0.9.2
peerlibrary:blaze-components@0.10.0 peerlibrary:blaze-components@0.11.0
raix:eventemitter@0.1.2 raix:eventemitter@0.1.2
raix:handlebar-helpers@0.2.4 raix:handlebar-helpers@0.2.4
random@1.0.3 random@1.0.3

View file

@ -12,18 +12,18 @@ template(name="boardComponent")
each lists each lists
+list(this) +list(this)
if currentUser.isBoardMember if currentUser.isBoardMember
+addlistForm +addListForm
+boardSidebar +boardSidebar
if currentCard if currentCard
+cardSidebar(currentCard) +cardSidebar(currentCard)
else else
+message(label="board-no-found") +message(label="board-no-found")
template(name="addlistForm") template(name="addListForm")
.list.js-list.add-list.js-add-list .list.js-list.add-list.js-add-list
+inlinedForm(autoclose=false) +inlinedForm(autoclose=false)
input.list-name-input(type="text" placeholder="{{_ 'add-list'}}" input.list-name-input(type="text" placeholder="{{_ 'add-list'}}"
autocomplete="off" autofocus) autocomplete="off" autofocus value=getCache)
div.edit-controls.clearfix div.edit-controls.clearfix
button.primary.confirm.js-save-edit(type="submit") {{_ 'save'}} button.primary.confirm.js-save-edit(type="submit") {{_ 'save'}}
a.fa.fa-times.dark-hover.cancel.js-close-inlined-form a.fa.fa-times.dark-hover.cancel.js-close-inlined-form

View file

@ -4,7 +4,7 @@ BlazeComponent.extendComponent({
}, },
openNewListForm: function() { openNewListForm: function() {
this.componentChildren('addlistForm')[0].open(); this.componentChildren('addListForm')[0].open();
}, },
scrollLeft: function() { scrollLeft: function() {
@ -60,11 +60,29 @@ BlazeComponent.extendComponent({
BlazeComponent.extendComponent({ BlazeComponent.extendComponent({
template: function() { template: function() {
return 'addlistForm'; return 'addListForm';
}, },
// Proxy // Proxy
open: function() { open: function() {
this.componentChildren('inlinedForm')[0].open(); this.componentChildren('inlinedForm')[0].open();
},
events: function() {
return [{
submit: function(evt) {
evt.preventDefault();
var title = this.find('.list-name-input');
if ($.trim(title.value)) {
Lists.insert({
title: title.value,
boardId: Session.get('currentBoard'),
sort: $('.list').length
});
title.value = '';
}
}
}];
} }
}).register('addlistForm'); }).register('addListForm');

View file

@ -1,45 +1,45 @@
@import 'nib' @import 'nib'
.card-detail.sidebar-content .card-sidebar.sidebar
width: 496px - 2 * 20px width: 496px
top: -46px !important top: -46px
z-index: 20 !important
// XXX Animate apparition
.card-detail-header .card-detail.sidebar-content
background: #F7F7F7 padding: 0 20px
border-bottom: 1px solid darken(white, 10%) z-index: 20 !important
position: absolute // XXX Animate apparition
min-height: 38px
top: 0
left: 0
right: 0
padding 7px 20px 0
i.fa .card-detail-header
float: right margin: 0 -20px 5px
font-size: 1.3em padding 7px 20px 0
color: darken(white, 35%) background: #F7F7F7
margin-top: 7px border-bottom: 1px solid darken(white, 10%)
min-height: 38px
.card-detail-title i.fa
font-weight: bold float: right
font-size: 1.7em font-size: 1.3em
margin: 3px 0 0 color: darken(white, 35%)
padding: 0 margin-top: 7px
.card-detail-list .card-detail-title
font-size: 0.85em font-weight: bold
margin-bottom: 3px font-size: 1.7em
margin: 3px 0 0
padding: 0
a.card-detail-list-title .card-detail-list
font-weight: bold font-size: 0.85em
margin-bottom: 3px
&.is-editable a.card-detail-list-title
display: inline-block font-weight: bold
background: darken(white, 10%)
border-radius: 3px &.is-editable
padding: 0px 5px display: inline-block
background: darken(white, 10%)
border-radius: 3px
padding: 0px 5px
.new-comment .new-comment
position: relative position: relative

View file

@ -1,16 +0,0 @@
Template.addlistForm.events({
submit: function(event, t) {
event.preventDefault();
var title = t.find('.list-name-input');
if ($.trim(title.value)) {
Lists.insert({
title: title.value,
boardId: Session.get('currentBoard'),
sort: $('.list').length
});
Utils.Scroll('.js-lists').left(270, true);
title.value = '';
}
}
});

View file

@ -1,6 +1,11 @@
@import 'nib' @import 'nib'
.sidebar .sidebar
position: absolute
top: 0
bottom: 0
right: 0
.sidebar-content .sidebar-content
padding: 10px 20px padding: 10px 20px
background: white background: white
@ -22,10 +27,7 @@
.board-sidebar .board-sidebar
width: 248px width: 248px
position: absolute
top: 0
right: -@width right: -@width
bottom: 0
transition: top .1s, right .1s, width .1s transition: top .1s, right .1s, width .1s
&.is-open &.is-open
@ -104,7 +106,6 @@
.toggle-widget-nav .toggle-widget-nav
color: #4d4d4d color: #4d4d4d
.board-widget-title .board-widget-title
display: block display: block
min-height: 20px min-height: 20px