finished refactoring popup.js

This commit is contained in:
Sriram Hariharan
2019-08-13 14:25:30 -05:00
parent c3d243c471
commit 5c5cc48bb5
10 changed files with 288 additions and 267 deletions

View File

@@ -413,8 +413,7 @@ function getDescription(course_info) {
url: course_info["individual"],
success: function (response) {
if (response) {
response_node = $('<div/>').html(response).contents();
description_lines = response_node.find('#details > p').toArray().map(x => $(x).text());
description_lines = htmlToNode(response).find('#details > p').toArray().map(x => $(x).text());
displayDescription(buildFormattedDescription(description_lines));
let first_name = extractFirstName(response_node);
updateLinks(course_info, first_name);
@@ -433,7 +432,7 @@ function loadNextPages() {
toggleLoadingPage(true);
$.get(link, function (response) {
if (response) {
var next_page = $('<div/>').html(response).contents();
var next_page = htmlToNode(response);
var current = $('tbody');
var old_length = $('tbody tr').length;
var last = current.find('.course_header>h2:last').text();