Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
0904e9b1
Commit
0904e9b1
authored
Jan 27, 2017
by
Phil Hughes
Committed by
Fatih Acet
Feb 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Infinite scrolling
parent
ac7949db
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
6 deletions
+37
-6
app/assets/javascripts/boards/components/modal/index.js.es6
app/assets/javascripts/boards/components/modal/index.js.es6
+8
-1
app/assets/javascripts/boards/components/modal/list.js.es6
app/assets/javascripts/boards/components/modal/list.js.es6
+20
-4
app/assets/javascripts/boards/stores/modal_store.js.es6
app/assets/javascripts/boards/stores/modal_store.js.es6
+3
-0
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+5
-0
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+1
-1
No files found.
app/assets/javascripts/boards/components/modal/index.js.es6
View file @
0904e9b1
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
return ModalStore.store;
return ModalStore.store;
},
},
watch: {
watch: {
page() {
this.loadIssues();
},
searchTerm() {
searchTerm() {
this.searchOperation();
this.searchOperation();
},
},
...
@@ -34,15 +37,17 @@
...
@@ -34,15 +37,17 @@
},
},
methods: {
methods: {
searchOperation: _.debounce(function searchOperationDebounce() {
searchOperation: _.debounce(function searchOperationDebounce() {
this.issues = [];
this.loadIssues();
this.loadIssues();
}, 500),
}, 500),
loadIssues() {
loadIssues() {
return gl.boardService.getBacklog({
return gl.boardService.getBacklog({
search: this.searchTerm,
search: this.searchTerm,
page: this.page,
per: this.perPage,
}).then((res) => {
}).then((res) => {
const data = res.json();
const data = res.json();
this.issues = [];
data.forEach((issueObj) => {
data.forEach((issueObj) => {
const issue = new ListIssue(issueObj);
const issue = new ListIssue(issueObj);
const foundSelectedIssue = ModalStore.findSelectedIssue(issue);
const foundSelectedIssue = ModalStore.findSelectedIssue(issue);
...
@@ -50,6 +55,8 @@
...
@@ -50,6 +55,8 @@
this.issues.push(issue);
this.issues.push(issue);
});
});
this.loadingNewPage = false;
});
});
},
},
},
},
...
...
app/assets/javascripts/boards/components/modal/list.js.es6
View file @
0904e9b1
...
@@ -14,10 +14,8 @@
...
@@ -14,10 +14,8 @@
this.initMasonry();
this.initMasonry();
},
},
issues: {
issues: {
handler(issues, oldIssues) {
handler() {
if (this.activeTab === 'selected' || issues.length !== oldIssues.length) {
this.initMasonry();
this.initMasonry();
}
},
},
deep: true,
deep: true,
},
},
...
@@ -33,6 +31,15 @@
...
@@ -33,6 +31,15 @@
},
},
methods: {
methods: {
toggleIssue: ModalStore.toggleIssue.bind(ModalStore),
toggleIssue: ModalStore.toggleIssue.bind(ModalStore),
listHeight () {
return this.$refs.list.getBoundingClientRect().height;
},
scrollHeight () {
return this.$refs.list.scrollHeight;
},
scrollTop () {
return this.$refs.list.scrollTop + this.listHeight();
},
showIssue(issue) {
showIssue(issue) {
if (this.activeTab === 'all') return true;
if (this.activeTab === 'all') return true;
...
@@ -59,6 +66,15 @@
...
@@ -59,6 +66,15 @@
},
},
mounted() {
mounted() {
this.initMasonry();
this.initMasonry();
this.$refs.list.onscroll = () => {
const currentPage = Math.floor(this.issues.length / this.perPage);
if ((this.scrollTop() > this.scrollHeight() - 100) && !this.loadingNewPage && currentPage === this.page) {
this.loadingNewPage = true;
this.page += 1;
}
};
},
},
destroyed() {
destroyed() {
this.destroyMasonry();
this.destroyMasonry();
...
...
app/assets/javascripts/boards/stores/modal_store.js.es6
View file @
0904e9b1
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
selectedList: {},
selectedList: {},
searchTerm: '',
searchTerm: '',
loading: false,
loading: false,
loadingNewPage: false,
page: 1,
perPage: 50,
};
};
}
}
...
...
app/assets/stylesheets/pages/boards.scss
View file @
0904e9b1
...
@@ -372,6 +372,7 @@
...
@@ -372,6 +372,7 @@
flex-direction
:
column
;
flex-direction
:
column
;
width
:
90vw
;
width
:
90vw
;
height
:
85vh
;
height
:
85vh
;
max-width
:
1100px
;
min-height
:
500px
;
min-height
:
500px
;
margin
:
auto
;
margin
:
auto
;
padding
:
25px
15px
0
;
padding
:
25px
15px
0
;
...
@@ -396,6 +397,8 @@
...
@@ -396,6 +397,8 @@
margin
:
-25px
-15px
-5px
;
margin
:
-25px
-15px
-5px
;
border-top
:
0
;
border-top
:
0
;
border-bottom
:
1px
solid
$border-color
;
border-bottom
:
1px
solid
$border-color
;
border-top-right-radius
:
$border-radius-default
;
border-top-left-radius
:
$border-radius-default
;
>
h2
{
>
h2
{
margin
:
0
;
margin
:
0
;
...
@@ -448,6 +451,8 @@
...
@@ -448,6 +451,8 @@
margin-right
:
-15px
;
margin-right
:
-15px
;
padding-left
:
15px
;
padding-left
:
15px
;
padding-right
:
15px
;
padding-right
:
15px
;
border-bottom-right-radius
:
$border-radius-default
;
border-bottom-left-radius
:
$border-radius-default
;
}
}
.add-issues-footer-to-list
{
.add-issues-footer-to-list
{
...
...
app/controllers/projects/boards_controller.rb
View file @
0904e9b1
...
@@ -33,7 +33,7 @@ class Projects::BoardsController < Projects::ApplicationController
...
@@ -33,7 +33,7 @@ class Projects::BoardsController < Projects::ApplicationController
LabelLink
.
where
(
"label_links.target_type = 'Issue' AND label_links.target_id = issues.id"
)
LabelLink
.
where
(
"label_links.target_type = 'Issue' AND label_links.target_id = issues.id"
)
.
where
(
label_id:
board
.
lists
.
movable
.
pluck
(
:label_id
)).
limit
(
1
).
arel
.
exists
.
where
(
label_id:
board
.
lists
.
movable
.
pluck
(
:label_id
)).
limit
(
1
).
arel
.
exists
)
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
50
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
params
[
:per
]
)
render
json:
@issues
.
as_json
(
render
json:
@issues
.
as_json
(
labels:
true
,
labels:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment