Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change reset/export button locations. Helps with mobile (viewing calculated grades) #347

Merged
merged 2 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions public/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,17 @@ i.fa.fa-toolbox {
cursor: pointer;
}

#buttonsTable .tabulator-tableHolder{
position: absolute;
left: -10000000000000000000000000px;
}

#buttonsTable .tabulator-headers{
display: flex;
justify-content: flex-end;

}

#classesTable .tabulator-col,
#classesTable .tabulator-header,
#assignmentsTable .tabulator-col,
Expand Down
1 change: 1 addition & 0 deletions public/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ <h3 id="import_modal_title">Import Data</h3>
</div>

<div id="grades" class="tabcontent">
<div id="buttonsTable"></div>
<div id="classesTable"></div>
<div id="mostRecentDiv" style="display:none">
<!-- hide most recent activity; removed from aspen -->
Expand Down
65 changes: 38 additions & 27 deletions public/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,38 +758,13 @@ let scheduleTable = new Tabulator("#scheduleTable", {
],
});

let classesTable = new Tabulator("#classesTable", {
let buttonsTable = new Tabulator("#buttonsTable", {
//height:205, // set height of table (in CSS or here), this enables the Virtual DOM and improves render speed dramatically (can be any valid css height value)
index: "name",
selectable: 1,
headerHozAlign:"right",
layout: "fitColumns", //fit columns to width of table (optional)
columns: [ // Define Table Columns
{
title: "Class",
field: "name",
formatter: cell => {
let rowColor = cell.getRow().getData().color;
let value = cell.getValue();

if (vip_username_list.includes(currentTableData.username)) {
return "<span style='background: -webkit-linear-gradient(left, red, orange, green, blue, purple);-webkit-background-clip: text; -webkit-text-fill-color:transparent; font-weight:bold;'>" + value + "</span>";
}
if (rowColor === "black") {
return value;
} else {
return "<span style='color:" + rowColor + "; font-weight:bold;'>" + value + "</span>";
}
},
headerSort: false,
},
{
title: "Grade",
field: "grade",
align: "left",
formatter: gradeFormatter,
headerSort: false,
width: window.matchMedia("(max-width: 576px)").matches ? 100 : "",
},
{
title: "Export Table Data",
titleFormatter: () => '<i class="fa fa-file-download header-icon tooltip" aria-hidden="true" tooltip="Export Grades"></i>',
Expand Down Expand Up @@ -826,6 +801,42 @@ let classesTable = new Tabulator("#classesTable", {
headerSort: false,
cssClass: "icon-col"
},
],
}
);

let classesTable = new Tabulator("#classesTable", {
//height:205, // set height of table (in CSS or here), this enables the Virtual DOM and improves render speed dramatically (can be any valid css height value)
index: "name",
selectable: 1,
layout: "fitColumns", //fit columns to width of table (optional)
columns: [ // Define Table Columns
{
title: "Class",
field: "name",
formatter: cell => {
let rowColor = cell.getRow().getData().color;
let value = cell.getValue();

if (vip_username_list.includes(currentTableData.username)) {
return "<span style='background: -webkit-linear-gradient(left, red, orange, green, blue, purple);-webkit-background-clip: text; -webkit-text-fill-color:transparent; font-weight:bold;'>" + value + "</span>";
}
if (rowColor === "black") {
return value;
} else {
return "<span style='color:" + rowColor + "; font-weight:bold;'>" + value + "</span>";
}
},
headerSort: false,
},
{
title: "Grade",
field: "grade",
align: "left",
formatter: gradeFormatter,
headerSort: false,
width: window.matchMedia("(max-width: 576px)").matches ? 100 : "",
},
],
rowClick: function(e, row) { // trigger an alert message when the row is clicked
$("#mostRecentDiv").hide();
Expand Down