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
ordered-dict@1.0.3
peerlibrary:assert@0.2.5
peerlibrary:base-component@0.8.0
peerlibrary:blaze-components@0.10.0
peerlibrary:base-component@0.9.2
peerlibrary:blaze-components@0.11.0
raix:eventemitter@0.1.2
raix:handlebar-helpers@0.2.4
random@1.0.3

View file

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

View file

@ -4,7 +4,7 @@ BlazeComponent.extendComponent({
},
openNewListForm: function() {
this.componentChildren('addlistForm')[0].open();
this.componentChildren('addListForm')[0].open();
},
scrollLeft: function() {
@ -60,11 +60,29 @@ BlazeComponent.extendComponent({
BlazeComponent.extendComponent({
template: function() {
return 'addlistForm';
return 'addListForm';
},
// Proxy
open: function() {
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'
.card-detail.sidebar-content
width: 496px - 2 * 20px
top: -46px !important
z-index: 20 !important
// XXX Animate apparition
.card-sidebar.sidebar
width: 496px
top: -46px
.card-detail-header
background: #F7F7F7
border-bottom: 1px solid darken(white, 10%)
position: absolute
min-height: 38px
top: 0
left: 0
right: 0
padding 7px 20px 0
.card-detail.sidebar-content
padding: 0 20px
z-index: 20 !important
// XXX Animate apparition
i.fa
float: right
font-size: 1.3em
color: darken(white, 35%)
margin-top: 7px
.card-detail-header
margin: 0 -20px 5px
padding 7px 20px 0
background: #F7F7F7
border-bottom: 1px solid darken(white, 10%)
min-height: 38px
.card-detail-title
font-weight: bold
font-size: 1.7em
margin: 3px 0 0
padding: 0
i.fa
float: right
font-size: 1.3em
color: darken(white, 35%)
margin-top: 7px
.card-detail-list
font-size: 0.85em
margin-bottom: 3px
.card-detail-title
font-weight: bold
font-size: 1.7em
margin: 3px 0 0
padding: 0
a.card-detail-list-title
font-weight: bold
.card-detail-list
font-size: 0.85em
margin-bottom: 3px
&.is-editable
display: inline-block
background: darken(white, 10%)
border-radius: 3px
padding: 0px 5px
a.card-detail-list-title
font-weight: bold
&.is-editable
display: inline-block
background: darken(white, 10%)
border-radius: 3px
padding: 0px 5px
.new-comment
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'
.sidebar
position: absolute
top: 0
bottom: 0
right: 0
.sidebar-content
padding: 10px 20px
background: white
@ -22,10 +27,7 @@
.board-sidebar
width: 248px
position: absolute
top: 0
right: -@width
bottom: 0
transition: top .1s, right .1s, width .1s
&.is-open
@ -104,7 +106,6 @@
.toggle-widget-nav
color: #4d4d4d
.board-widget-title
display: block
min-height: 20px