Skip to content
Open
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: 0 additions & 5 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"axios": "^0.19.2",
"cache-loader": "^4.1.0",
"cgi": "^0.3.1",
"jquery": "^3.5.1",
"material-design-icons-iconfont": "^4.0.5",
"moment": "^2.29.1",
"thread-loader": "^3.0.1",
Expand Down
6 changes: 4 additions & 2 deletions src/components/ClassInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
</template>

<script>
import $ from 'jquery';
import SubjectScroll from '../components/SubjectScroll.vue';
import ExpansionReqs from '../components/ExpansionReqs.vue';
import colorMixin from './../mixins/colorMixin.js';
Expand Down Expand Up @@ -302,7 +301,7 @@ export default {
},
clickRelatedSubject: function (subject) {
this.$store.commit('pushClassStack', subject.id);
$('#cardBody').animate({ scrollTop: 0 });
document.getElementById('cardBody').scrollTop = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer animates the scroll nicely. Not sure if there is a way to animate this without jquery? The scroll-behavior:smooth doesn't seem to be having the same effect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two ways we can do this: figure out the CSS animation or drop in a replacement for jQuery that only handles animations. I can't comment on the former since I'm atrociously awful at CSS animation, but I have used Velocity.js as a replacement for jQuery before. It only contains animation libraries and should be smaller than jQuery, while also having more responsive animations in comparison.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think vuetify also has transitions that could be helpful here

},
parseRequirements: function (requirements) {
// TODO: a way to make this more ETU?
Expand Down Expand Up @@ -512,4 +511,7 @@ table td:first-child {
padding-right: 1em;
}

#cardBody {
scroll-behavior: smooth;
}
</style>
21 changes: 8 additions & 13 deletions src/components/ClassSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

<script>
import FilterSet from './FilterSet.vue';
import $ from 'jquery';
import Vue from 'vue';
import { FilterGroup, RegexFilter, MathFilter, BooleanFilter } from './../utilities/filters.js';

Expand Down Expand Up @@ -197,9 +196,7 @@ export default {
});

window.cookies = this.$cookies;
$(window).resize(function () {
this.updateMenuStyle();
}.bind(this));
window.addEventListener('resize', this.updateMenuStyle.bind(this));

if (this.$cookies.isKey('paginationRows')) {
this.pagination.rowsPerPage = parseInt(this.$cookies.get('paginationRows'));
Expand All @@ -214,19 +211,17 @@ export default {
isNew: true
});
},
// Change search menu size based on existence of class info card
updateMenuStyle: function () {
const searchInputElem = document.getElementById('searchInputTF');
const searchInputRect = searchInputElem.getBoundingClientRect();
const searchMenuTop = searchInputRect.top + searchInputRect.height;
const searchInput = $('#searchInputTF');
const menuWidth = searchInput.outerWidth();
const classInfoCard = $('#classInfoCard');
let menuBottom;
if (classInfoCard.length) {
menuBottom = classInfoCard.position().top;
} else {
menuBottom = $(window).innerHeight();
}
const searchInput = document.getElementById('searchInputTF');
const menuWidth = searchInput.offsetWidth;
const classInfoCard = document.getElementById('classInfoCard');
const menuBottom = classInfoCard
? classInfoCard.getBoundingClientRect().top
: window.innerHeight;
const maxHeight = menuBottom - searchMenuTop - this.menuMargin;
this.searchHeight = 'max-height: ' + maxHeight + 'px;width: ' + menuWidth + 'px;';
},
Expand Down
21 changes: 11 additions & 10 deletions src/components/ExpansionReqs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

<script>
import SubjectScroll from '../components/SubjectScroll.vue';
import $ from 'jquery';
import Vue from 'vue';

export default {
Expand Down Expand Up @@ -118,10 +117,11 @@ export default {
this.expansionIndex = subj.index;
this.open = true;
Vue.nextTick(function () {
const scrollPoint = $('#' + $.escapeSelector(scrollPointID));
const topPoint = scrollPoint.offset().top;
const cardBody = $('#cardBody');
cardBody.animate({ scrollTop: topPoint - cardBody.offset().top + cardBody.scrollTop() - 10 }, 200);
const scrollPoint = document.getElementById(escape(scrollPointID));
const topPoint = scrollPoint.getBoundingClientRect().top;
const cardBody = document.getElementById('cardBody');
const cardTopPoint = cardBody.getBoundingClientRect().top;
cardBody.scrollTop = topPoint - cardTopPoint + cardBody.scrollTop - 10;
});
} else {
if (subj.id.indexOf('GIR:') >= 0) {
Expand All @@ -137,13 +137,14 @@ export default {
this.open = false;
let scrollPoint;
if (!this.doubleScroller) {
scrollPoint = $('#' + $.escapeSelector(this.reqID));
scrollPoint = document.getElementById(escape(this.reqID));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This scrolling also does not seem to be animated anymore.

} else {
scrollPoint = $('#ds' + this.whichScroller + $.escapeSelector(this.reqID));
scrollPoint = document.getElementById('ds' + this.whichScroller + escape(this.reqID));
}
const topPoint = scrollPoint.offset().top;
const cardBody = $('#cardBody');
cardBody.animate({ scrollTop: topPoint - cardBody.offset().top + cardBody.scrollTop() - 10 }, 350);
const topPoint = scrollPoint.getBoundingClientRect().top;
const cardBody = document.getElementById('cardBody');
const cardTopPoint = cardBody.getBoundingClientRect().top;
cardBody.scrollTop = topPoint - cardTopPoint + cardBody.scrollTop - 10;
}
}
};
Expand Down
10 changes: 0 additions & 10 deletions src/pages/MainPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ import RoadTabs from './../components/RoadTabs.vue';
import ConflictDialog from './../components/ConflictDialog.vue';
import Auth from './../components/Auth.vue';
import axios from 'axios';
import $ from 'jquery';
import moment from 'moment';
import UAParser from 'ua-parser-js';
import Vue from 'vue';
Expand Down Expand Up @@ -334,15 +333,6 @@ export default {
if (localStorage.courseRoadStore !== undefined && this.cookiesAllowed && this.$store.state.loggedIn) {
this.$store.commit('setFromLocalStorage', JSON.parse(localStorage.courseRoadStore));
};
const borders = $('.v-navigation-drawer__border');
const scrollers = $('.scroller');
const scrollWidth = scrollers.width();
// moves nav drawer border with scroll
// if the effect proves too annoying we can remove the borders instead
scrollers.scroll(function () {
const scrollPosition = scrollers.scrollLeft();
borders.css({ top: 0, left: scrollWidth - 1 + scrollPosition });
});

this.setActiveRoad();

Expand Down