Commit a09b850a authored by Phil Hughes's avatar Phil Hughes

Mobile improvements

parent 324067e2
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
} }
}, },
ready: function () { ready: function () {
const options = _.extend({ let options = _.extend({
disabled: this.disabled, disabled: this.disabled,
group: 'boards', group: 'boards',
draggable: '.is-draggable', draggable: '.is-draggable',
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
} }
}, gl.boardSortableDefaultOptions); }, gl.boardSortableDefaultOptions);
if (bp.getBreakpointSize() === 'sm' || bp.getBreakpointSize() === 'xs') {
options.handle = '.js-board-drag-handle';
}
Sortable.create(this.$el.parentNode, options); Sortable.create(this.$el.parentNode, options);
} }
}); });
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
}, },
ready: function () { ready: function () {
const list = this.list; const list = this.list;
const options = _.extend({ let options = _.extend({
group: 'issues', group: 'issues',
disabled: this.disabled, disabled: this.disabled,
onAdd: (e) => { onAdd: (e) => {
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
} }
}, gl.boardSortableDefaultOptions); }, gl.boardSortableDefaultOptions);
if (bp.getBreakpointSize() === 'sm' || bp.getBreakpointSize() === 'xs') {
options.handle = '.js-card-drag-handle';
}
Sortable.create(this.$els.list, options); Sortable.create(this.$els.list, options);
// Scroll event on list to load more // Scroll event on list to load more
......
(function (w) { ((w) => {
if (!window.gl) { if (!window.gl) {
window.gl = {}; window.gl = {};
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
fallbackOnBody: true, fallbackOnBody: true,
ghostClass: 'is-ghost', ghostClass: 'is-ghost',
filter: '.has-tooltip', filter: '.has-tooltip',
scrollSensitivity: 50, scrollSensitivity: 100,
scrollSpeed: 10, scrollSpeed: 10,
onStart: function () { onStart: function () {
document.body.classList.add('is-dragging'); document.body.classList.add('is-dragging');
......
...@@ -140,10 +140,19 @@ ...@@ -140,10 +140,19 @@
} }
.board-title { .board-title {
position: relative;
margin: 0; margin: 0;
padding: $gl-padding; padding: $gl-padding;
font-size: 1em; font-size: 1em;
border-bottom: 1px solid $border-color; border-bottom: 1px solid $border-color;
.board-mobile-handle {
position: relative;
left: 0;
top: 1px;
margin-top: 0;
margin-right: 5px;
}
} }
.board-search-container { .board-search-container {
...@@ -241,6 +250,7 @@ ...@@ -241,6 +250,7 @@
} }
.card { .card {
position: relative;
width: 100%; width: 100%;
padding: 10px $gl-padding; padding: 10px $gl-padding;
background: #fff; background: #fff;
...@@ -248,6 +258,14 @@ ...@@ -248,6 +258,14 @@
box-shadow: 0 1px 2px rgba(186, 186, 186, 0.5); box-shadow: 0 1px 2px rgba(186, 186, 186, 0.5);
list-style: none; list-style: none;
&.user-can-drag {
padding-left: ($gl-padding * 2);
@media (min-width: $screen-sm-min) {
padding-left: $gl-padding;
}
}
&:not(:last-child) { &:not(:last-child) {
margin-bottom: 5px; margin-bottom: 5px;
} }
...@@ -262,6 +280,17 @@ ...@@ -262,6 +280,17 @@
} }
} }
.board-mobile-handle {
position: absolute;
left: 10px;
top: 50%;
margin-top: (-15px / 2);
@media (min-width: $screen-sm-min) {
display: none;
}
}
.card-title { .card-title {
margin: 0; margin: 0;
font-size: 1em; font-size: 1em;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
.board-inner .board-inner
%header.board-header{ ":class" => "{ 'has-border': list.label }", ":style" => "{ borderTopColor: (list.label ? list.label.color : null) }" } %header.board-header{ ":class" => "{ 'has-border': list.label }", ":style" => "{ borderTopColor: (list.label ? list.label.color : null) }" }
%h3.board-title.js-board-handle{ ":class" => "{ 'user-can-drag': (!disabled && !isPreset) }" } %h3.board-title.js-board-handle{ ":class" => "{ 'user-can-drag': (!disabled && !isPreset) }" }
= icon("align-justify", class: "board-mobile-handle js-board-drag-handle", "v-if" => "(!disabled && !isPreset)")
{{ list.title }} {{ list.title }}
%span.pull-right{ "v-if" => "list.type !== 'blank'" } %span.pull-right{ "v-if" => "list.type !== 'blank'" }
{{ list.issues.length }} {{ list.issues.length }}
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"track-by" => "id" } "track-by" => "id" }
%li.card{ ":data-issue" => "issue.id", %li.card{ ":data-issue" => "issue.id",
":class" => "{ 'user-can-drag': !disabled }" } ":class" => "{ 'user-can-drag': !disabled }" }
= icon("align-justify", class: "board-mobile-handle js-card-drag-handle", "v-if" => "!disabled")
%h4.card-title %h4.card-title
%a{ ":href" => "issueLinkBase + '/' + issue.id", %a{ ":href" => "issueLinkBase + '/' + issue.id",
":title" => "issue.title" } ":title" => "issue.title" }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment