From 018bb343b5eadba9b8367286634c39db454a53fa Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 14 May 2015 15:21:48 +0200 Subject: Fix new list form Fixes #157. --- client/components/boards/body.jade | 6 +-- client/components/boards/body.js | 24 ++++++++-- client/components/cards/details.styl | 80 +++++++++++++++++----------------- client/components/lists/events.js | 16 ------- client/components/sidebar/sidebar.styl | 9 ++-- 5 files changed, 69 insertions(+), 66 deletions(-) delete mode 100644 client/components/lists/events.js (limited to 'client') diff --git a/client/components/boards/body.jade b/client/components/boards/body.jade index 5406ee2f..4abc0baf 100644 --- a/client/components/boards/body.jade +++ b/client/components/boards/body.jade @@ -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 diff --git a/client/components/boards/body.js b/client/components/boards/body.js index 2b4baf53..78566f2e 100644 --- a/client/components/boards/body.js +++ b/client/components/boards/body.js @@ -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'); diff --git a/client/components/cards/details.styl b/client/components/cards/details.styl index faf15d79..106a9cfd 100644 --- a/client/components/cards/details.styl +++ b/client/components/cards/details.styl @@ -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-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 - - i.fa - float: right - font-size: 1.3em - color: darken(white, 35%) - margin-top: 7px - - .card-detail-title - font-weight: bold - font-size: 1.7em - margin: 3px 0 0 - padding: 0 - - .card-detail-list - font-size: 0.85em - margin-bottom: 3px - - a.card-detail-list-title - font-weight: bold - - &.is-editable - display: inline-block - background: darken(white, 10%) - border-radius: 3px - padding: 0px 5px +.card-sidebar.sidebar + width: 496px + top: -46px + + .card-detail.sidebar-content + padding: 0 20px + z-index: 20 !important + // XXX Animate apparition + + .card-detail-header + margin: 0 -20px 5px + padding 7px 20px 0 + background: #F7F7F7 + border-bottom: 1px solid darken(white, 10%) + min-height: 38px + + i.fa + float: right + font-size: 1.3em + color: darken(white, 35%) + margin-top: 7px + + .card-detail-title + font-weight: bold + font-size: 1.7em + margin: 3px 0 0 + padding: 0 + + .card-detail-list + font-size: 0.85em + margin-bottom: 3px + + 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 diff --git a/client/components/lists/events.js b/client/components/lists/events.js deleted file mode 100644 index f636de75..00000000 --- a/client/components/lists/events.js +++ /dev/null @@ -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 = ''; - } - } -}); diff --git a/client/components/sidebar/sidebar.styl b/client/components/sidebar/sidebar.styl index 4b741dc7..a5bc3dc5 100644 --- a/client/components/sidebar/sidebar.styl +++ b/client/components/sidebar/sidebar.styl @@ -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 -- cgit v1.2.3-1-g7c22