Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
e5d066d5
Commit
e5d066d5
authored
Jan 18, 2007
by
Martyn Smith
Committed by
Martyn Smith
Jan 18, 2007
Browse files
Don't display pagination if we only have one page
parent
e8f8c397
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/js/tablerenderer.js
View file @
e5d066d5
...
...
@@ -54,6 +54,12 @@ function TableRenderer(target, source, columns, options) {
}
if
(
!
self
.
pager
||
self
.
pager
.
options
.
lastPage
!=
Math
.
floor
(
(
count
-
1
)
/
limit
)
+
1
)
{
if
(
self
.
pager
)
{
if
(
self
.
headRow
)
{
removeElement
(
self
.
headRow
);
}
if
(
self
.
footRow
)
{
removeElement
(
self
.
footRow
);
}
self
.
pager
.
removeAllInstances
();
}
self
.
pager
=
new
Pager
(
count
,
limit
,
{
...
...
@@ -65,16 +71,22 @@ function TableRenderer(target, source, columns, options) {
'
firstPageString
'
:
get_string
(
'
firstpage
'
)
});
var
headRow
=
TR
(
null
,
TD
({
'
colspan
'
:
self
.
linkspan
},
self
.
pager
.
newDisplayInstance
()));
var
footRow
=
TR
(
null
,
TD
({
'
colspan
'
:
self
.
linkspan
},
self
.
pager
.
newDisplayInstance
()));
if
(
self
.
pager
.
options
.
lastPage
==
1
)
{
self
.
headRow
=
null
;
self
.
footRow
=
null
;
return
;
}
self
.
headRow
=
TR
(
null
,
TD
({
'
colspan
'
:
self
.
linkspan
},
self
.
pager
.
newDisplayInstance
()));
self
.
footRow
=
TR
(
null
,
TD
({
'
colspan
'
:
self
.
linkspan
},
self
.
pager
.
newDisplayInstance
()));
if
(
self
.
thead
.
firstChild
)
{
insertSiblingNodesBefore
(
self
.
thead
.
firstChild
,
headRow
);
insertSiblingNodesBefore
(
self
.
thead
.
firstChild
,
self
.
headRow
);
}
else
{
appendChildNodes
(
self
.
thead
,
headRow
);
appendChildNodes
(
self
.
thead
,
self
.
headRow
);
}
appendChildNodes
(
self
.
tfoot
,
footRow
);
appendChildNodes
(
self
.
tfoot
,
self
.
footRow
);
}
}
...
...
Write
Preview
Supports
Markdown
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