-
Notifications
You must be signed in to change notification settings - Fork 0
Erratic loads #564
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
Erratic loads #564
Changes from 6 commits
10eb6f5
49752b7
9aa4384
7ffa2dd
3a209ae
c5d6acd
4bc9de9
ad7ec82
2920a4b
b636a19
7900b37
925fa62
183d21d
726e3b0
d3d6818
ff68c32
8785848
9421116
d2ec15d
0b5f9d3
b79642c
6f15b08
460aa7a
5ddb1a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -358,16 +358,17 @@ function loadOverloadModal(formHistoryID, laborStatusFormID) { | |
| This method sends an AJAX call to recieve data used to populate | ||
| the overload modal. | ||
| */ | ||
|
|
||
| $("#overloadModal").find(".modal-content").html('<div class="modal-body">Loading...</div>'); | ||
| $("#overloadModal").find('.modal-content').load('/admin/overloadModal/' + formHistoryID) ; | ||
| $("#overloadModal").modal("show"); | ||
| $("#overloadModal").find('.modal-content').load('/admin/overloadModal/' + formHistoryID); | ||
| } | ||
|
|
||
|
|
||
| function loadReleaseModal(formHistoryID, laborStatusFormID) { | ||
| $("#modalRelease").modal("show"); | ||
| $("#modalRelease").find('.modal-content').html('<div class="modal-body">Loading...</div>'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we setting the HTML to Loading if we're going to set it to the actual content in the next line? Also I love this fix!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good one, I have fixed it now. Currently, it will no longer be in that order; it will set it to loading and then render it, giving it time to display the content from the ajax request. |
||
| $("#modalRelease").find('.modal-content').load('/admin/releaseModal/' + formHistoryID); | ||
|
|
||
|
|
||
| $("#modalRelease").modal("show"); | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -604,7 +605,7 @@ function notesCounter(laborStatusFormID, formHistoryID){ | |
| success: function(response) { | ||
| var viewNotesID = '#notes_' + String(formHistoryID) | ||
| var modalViewNotesID = '#modalNote_' + String(formHistoryID) | ||
| $(viewNotesID).html('View Notes (' + response['noteTotal'] + ')') | ||
| $(viewNotesID).html('Notes (' + response['noteTotal'] + ')') | ||
| $(modalViewNotesID).html('View Notes (' + response['noteTotal'] + ')') | ||
| }, | ||
| error: function(request,status,error){ | ||
|
|
||
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.
Also curious about the use of the "Loading..." text here
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 need for the "Loading..." is because the modal content persists from the last time it was opened. This creates a "flash" of the wrong student's data, followed by a self-correction when it is updated.
Through the way that it is handeld we are creating a buffer that is user-friendly (as it gives visual feedback), at the same time, renders the right information.