BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
6 deletions
+37
-6
index.js.es6
app/assets/javascripts/boards/components/modal/index.js.es6
+8
-1
list.js.es6
app/assets/javascripts/boards/components/modal/list.js.es6
+20
-4
modal_store.js.es6
app/assets/javascripts/boards/stores/modal_store.js.es6
+3
-0
boards.scss
app/assets/stylesheets/pages/boards.scss
+5
-0
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 @@
return ModalStore.store;
},
watch: {
page() {
this.loadIssues();
},
searchTerm() {
this.searchOperation();
},
...
...
@@ -34,15 +37,17 @@
},
methods: {
searchOperation: _.debounce(function searchOperationDebounce() {
this.issues = [];
this.loadIssues();
}, 500),
loadIssues() {
return gl.boardService.getBacklog({
search: this.searchTerm,
page: this.page,
per: this.perPage,
}).then((res) => {
const data = res.json();
this.issues = [];
data.forEach((issueObj) => {
const issue = new ListIssue(issueObj);
const foundSelectedIssue = ModalStore.findSelectedIssue(issue);
...
...
@@ -50,6 +55,8 @@
this.issues.push(issue);
});
this.loadingNewPage = false;
});
},
},
...
...
app/assets/javascripts/boards/components/modal/list.js.es6
View file @
0904e9b1
...
...
@@ -14,10 +14,8 @@
this.initMasonry();
},
issues: {
handler(issues, oldIssues) {
if (this.activeTab === 'selected' || issues.length !== oldIssues.length) {
this.initMasonry();
}
handler() {
this.initMasonry();
},
deep: true,
},
...
...
@@ -33,6 +31,15 @@
},
methods: {
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) {
if (this.activeTab === 'all') return true;
...
...
@@ -59,6 +66,15 @@
},
mounted() {
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() {
this.destroyMasonry();
...
...
app/assets/javascripts/boards/stores/modal_store.js.es6
View file @
0904e9b1
...
...
@@ -12,6 +12,9 @@
selectedList: {},
searchTerm: '',
loading: false,
loadingNewPage: false,
page: 1,
perPage: 50,
};
}
...
...
app/assets/stylesheets/pages/boards.scss
View file @
0904e9b1
...
...
@@ -372,6 +372,7 @@
flex-direction
:
column
;
width
:
90vw
;
height
:
85vh
;
max-width
:
1100px
;
min-height
:
500px
;
margin
:
auto
;
padding
:
25px
15px
0
;
...
...
@@ -396,6 +397,8 @@
margin
:
-25px
-15px
-5px
;
border-top
:
0
;
border-bottom
:
1px
solid
$border-color
;
border-top-right-radius
:
$border-radius-default
;
border-top-left-radius
:
$border-radius-default
;
>
h2
{
margin
:
0
;
...
...
@@ -448,6 +451,8 @@
margin-right
:
-15px
;
padding-left
:
15px
;
padding-right
:
15px
;
border-bottom-right-radius
:
$border-radius-default
;
border-bottom-left-radius
:
$border-radius-default
;
}
.add-issues-footer-to-list
{
...
...
app/controllers/projects/boards_controller.rb
View file @
0904e9b1
...
...
@@ -33,7 +33,7 @@ class Projects::BoardsController < Projects::ApplicationController
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
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
50
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
params
[
:per
]
)
render
json:
@issues
.
as_json
(
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