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
ce0ec05c
Commit
ce0ec05c
authored
Jan 27, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pager.js to coffee
parent
e3c3c67b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
56 deletions
+42
-56
app/assets/javascripts/pager.js
app/assets/javascripts/pager.js
+0
-56
app/assets/javascripts/pager.js.coffee
app/assets/javascripts/pager.js.coffee
+42
-0
No files found.
app/assets/javascripts/pager.js
deleted
100644 → 0
View file @
e3c3c67b
var
Pager
=
{
limit
:
0
,
offset
:
0
,
disable
:
false
,
init
:
function
(
limit
,
preload
)
{
this
.
limit
=
limit
;
if
(
preload
)
{
this
.
offset
=
0
;
this
.
getOld
();
}
else
{
this
.
offset
=
limit
;
}
this
.
initLoadMore
();
},
getOld
:
function
()
{
$
(
'
.loading
'
).
show
();
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
data
:
"
limit=
"
+
this
.
limit
+
"
&offset=
"
+
this
.
offset
,
complete
:
function
(){
$
(
'
.loading
'
).
hide
()},
dataType
:
"
script
"
});
},
append
:
function
(
count
,
html
)
{
$
(
"
.content_list
"
).
append
(
html
);
if
(
count
>
0
)
{
this
.
offset
+=
count
;
}
else
{
this
.
disable
=
true
;
}
},
initLoadMore
:
function
()
{
$
(
document
).
endlessScroll
({
bottomPixels
:
400
,
fireDelay
:
1000
,
fireOnce
:
true
,
ceaseFire
:
function
()
{
return
Pager
.
disable
;
},
callback
:
function
(
i
)
{
$
(
'
.loading
'
).
show
();
Pager
.
getOld
();
}
});
}
}
app/assets/javascripts/pager.js.coffee
0 → 100644
View file @
ce0ec05c
@
Pager
=
limit
:
0
offset
:
0
disable
:
false
init
:
(
limit
,
preload
)
->
@
limit
=
limit
if
preload
@
offset
=
0
@
getOld
()
else
@
offset
=
limit
@
initLoadMore
()
getOld
:
->
$
(
".loading"
).
show
()
$
.
ajax
type
:
"GET"
url
:
location
.
href
data
:
"limit="
+
@
limit
+
"&offset="
+
@
offset
complete
:
->
$
(
".loading"
).
hide
()
dataType
:
"script"
append
:
(
count
,
html
)
->
$
(
".content_list"
).
append
html
if
count
>
0
@
offset
+=
count
else
@
disable
=
true
initLoadMore
:
->
$
(
document
).
endlessScroll
bottomPixels
:
400
fireDelay
:
1000
fireOnce
:
true
ceaseFire
:
->
Pager
.
disable
callback
:
(
i
)
->
$
(
".loading"
).
show
()
Pager
.
getOld
()
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