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

Fixed pause button on waterfall #290

Merged
merged 5 commits into from
Nov 9, 2023
Merged
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
48 changes: 30 additions & 18 deletions src/TagzApp.Web/wwwroot/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,18 +661,25 @@
`[data-providerid='${cursorProviderId}']`,
);
const rect = thisOne.getBoundingClientRect();
const aboveElements = document.elementsFromPoint(
rect.x - height,
rect.y,
);

// inspect the elements in aboveElements and assign the variable above to the first article element
var above = null;
for (var i = 0; i < aboveElements.length; i++) {
if (aboveElements[i].tagName == 'ARTICLE') {
above = aboveElements[i];
break;
for (var j = 0; j < 20; j++) {
// Look for an ARTICLE to the left of the current cursor position, if not found, look 10 pixels lower for an article

const aboveElements = document.elementsFromPoint(
rect.x - height,
rect.y + j * 10,
);

// inspect the elements in aboveElements and assign the variable above to the first article element
for (var i = 0; i < aboveElements.length; i++) {
if (aboveElements[i].tagName == 'ARTICLE') {
above = aboveElements[i];
break;
}
}

if (above != null && above.tagName == 'ARTICLE') break;
}

// check if above is an article element
Expand All @@ -698,18 +705,23 @@
`[data-providerid='${cursorProviderId}']`,
);
const rect = thisOne.getBoundingClientRect();
const aboveElements = document.elementsFromPoint(
rect.x + rect.width + height,
rect.y,
);

// inspect the elements in aboveElements and assign the variable above to the first article element
var above = null;
for (var i = 0; i < aboveElements.length; i++) {
if (aboveElements[i].tagName == 'ARTICLE') {
above = aboveElements[i];
break;
for (var j = 0; j < 20; j++) {
const aboveElements = document.elementsFromPoint(
rect.x + rect.width + height,
rect.y + j * 10,
);

// inspect the elements in aboveElements and assign the variable above to the first article element
for (var i = 0; i < aboveElements.length; i++) {
if (aboveElements[i].tagName == 'ARTICLE') {
above = aboveElements[i];
break;
}
}

if (above != null && above.tagName == 'ARTICLE') break;
}

// check if above is an article element
Expand Down