-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Scheduler scroll fix #3280
Scheduler scroll fix #3280
Conversation
app/static/js/events/scheduler.js
Outdated
var dayIndex = _.indexOf(days, day); | ||
|
||
if (/.+\/e\/.+\/schedule\//i.test(document.URL)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this test for ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is so that this changes take place only in the public page and not in the scheduler in event dashboard. Because in event dashboard we need the entire time rather than from start session to end session. Same for the room.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SaptakS use the isReadOnly()
function. isReadOnly()
returns a true
if the scheduler is running in the public page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok cool.
c62230c
to
9c1f7b9
Compare
@niranjan94 made the changes. Please review. |
app/static/js/events/scheduler.js
Outdated
@@ -919,6 +957,12 @@ function loadMicrolocationsToTimeline(day) { | |||
$("[data-toggle=tooltip]").tooltip("hide"); | |||
|
|||
if (isReadOnly()) { | |||
_.each($microlocations, function ($microlocation) { | |||
$microlocation = $($microlocation); | |||
if ($microlocation.find('.microlocation-inner').html().trim() === "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, a more straightforward way would be to count the children.
$microlocation.find('.microlocation-inner').children().length;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would give the same result, right? Can you explain why this is a better approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result would be the same ... In most cases ... But by chance (an edge case) due to some error in the template or js code, a non-whitespace character ends up inside the div
. Then just trimming and equating it to empty space would fail.
And it's always better to look at the DOM as an object instead of a string.
app/static/js/events/scheduler.js
Outdated
@@ -849,6 +848,10 @@ function loadDateButtons() { | |||
*/ | |||
function loadMicrolocationsToTimeline(day) { | |||
|
|||
$('table.timeline-table').show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move all selectors to the above (https://github.com/SaptakS/open-event-orga-server/blob/9c1f7b9f57ee26220ecd27825f818c7269e0e8bc/app/static/js/events/scheduler.js#L123) for consistency
app/static/js/events/scheduler.js
Outdated
@@ -849,6 +848,10 @@ function loadDateButtons() { | |||
*/ | |||
function loadMicrolocationsToTimeline(day) { | |||
|
|||
$('table.timeline-table').show(); | |||
$('#no-session-message').hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too
app/static/js/events/scheduler.js
Outdated
}); | ||
|
||
if (max_hours === 0) { | ||
$('table.timeline-table').hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These too
9c1f7b9
to
51e190c
Compare
Codecov Report
@@ Coverage Diff @@
## development #3280 +/- ##
===============================================
- Coverage 75.67% 75.57% -0.11%
===============================================
Files 226 226
Lines 14899 14899
===============================================
- Hits 11275 11260 -15
- Misses 3624 3639 +15
Continue to review full report at Codecov.
|
Fixes #3257
Works Done:
See the screenshots below
@mariobehling @niranjan94 pease review.