add a refresh button to the home page table

This commit is contained in:
ansuz 2016-08-03 11:36:22 +02:00
parent dd3a5d47be
commit e79d3d4d4e
4 changed files with 27 additions and 3 deletions

View File

@ -59,7 +59,7 @@
<th>Link</th>
<th>Created</th>
<th>Last Accessed</th>
<th></th> <!-- remove column -->
<th class="table-refresh" title="refresh listing"></th> <!-- remove column -->
</tr>
</tbody>

View File

@ -156,11 +156,16 @@ tbody tr {
text-align: center;
}
tbody tr:first-of-type th {
font-size: 20px;
border-top: 0px;
font-weight: bold;
padding: 10px;
text-decoration: underline;
}
tbody tr:first-of-type th.table-refresh {
color: #46E981;
text-decoration: none;
}
tbody tr:nth-child(odd) {
background-color: #685d56;
}

View File

@ -49,6 +49,12 @@ define([
var makeRecentPadsTable = function (recentPads) {
if (!recentPads.length) { return; }
$('tbody tr').each(function (i, e) {
if (!i) { return; }
$(this).remove();
});
recentPads.some(function (pad, index) {
if (!pad) { return; }
@ -112,8 +118,7 @@ define([
});
};
Cryptpad.ready(function () {
console.log("ready");
var refreshTable = function () {
Cryptpad.getRecentPads(function (err, recentPads) {
if (err) {
console.log("unable to get recent pads");
@ -131,6 +136,12 @@ define([
$tryit.text(Messages.recentPads);
}
});
};
Cryptpad.ready(function () {
console.log("ready");
refreshTable();
$('.table-refresh').click(refreshTable);
});
});

View File

@ -188,10 +188,17 @@ tbody {
tr {
text-align: center;
&:first-of-type th{
font-size: 20px;
border-top: 0px;
font-weight: bold;
padding: 10px;
text-decoration: underline;
&.table-refresh {
color: @cp-green;
text-decoration: none;
//border-bottom: 0px;
}
}
&:nth-child(odd) {
background-color: @light-base;
@ -210,6 +217,7 @@ tbody {
border-right: 0px;
}
}
.remove {
cursor: pointer !important;
color: @cp-red;