Skip to content

Commit

Permalink
Merge pull request #4 from dali-lab/elu-di-cpt
Browse files Browse the repository at this point in the history
Fix crash issues
  • Loading branch information
eric-lu-VT authored Oct 25, 2024
2 parents db5eb10 + 21546b4 commit 80baac8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 3 additions & 3 deletions grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@
<div id="dialog-flex" title="Warning!" align="center">
<span class="ui-icon ui-icon-alert" style="clear: both;"></span><span id="errorText"></span>
<br /><br />
<p style="font-size: 10px;">If you need help, don’t hesitate to contact us at
<p style="font-size: 10px;">If you have any questions, please contact OVIS at
<b>"[email protected]"</b>!</p>
</div>

<div id="dialog-notflex" title="ERROR!" align="center">
<span class="ui-icon ui-icon-alert" style="clear: both;"></span><span id="errorText2"></span>
<br /><br />
<p style="font-size: 10px;">If you need help, don’t hesitate to contact us at
<p style="font-size: 10px;">If you have any questions, please contact OVIS at
<b>"[email protected]"</b>!</p>
</div>

<div id="analysis-confirm" class="startHidden" title="Analysis" align="center">
<span class="ui-icon ui-icon-alert" style="clear: both;"></span><span id="analysisText"></span>
<br /><br />
<p style="font-size: 10px;">If you need help, don’t hesitate to contact us at
<p style="font-size: 10px;">If you have any questions, please contact OVIS at
<b>"[email protected]"</b>!</p>
</div>

Expand Down
14 changes: 5 additions & 9 deletions js/onLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,9 @@ $(function () {

var bool = "false";

console.log('here0.8', typeOfTerm)
if (typeOfTerm != "R") {
bool = "true";
console.log('here0.9');
if (!L_DI_CPT_Check_Rev(this, ReceiverId, typeOfTerm)) {
console.log('here0.91');
$(this).removeClass('T_S L_OPT L_LOA L_Thesis L_Earned L_Unearned L_DI_CPT');
if (useNotFlex == 0) {
$("#errorText2").html(REASON_FOR_ERROR);
Expand Down Expand Up @@ -1605,7 +1602,7 @@ $(function () {
var newID = "#" + newRow + "_" + newCol;

//get type of term
var lengthOfArray = $(newID).attr("class").split(' ').length;
var lengthOfArray = $(newID)?.attr("class")?.split(' ')?.length ?? 0;
var k = 0;
while (k <= lengthOfArray) {
if ($(newID).attr("class").split(' ')[k] == "RNotMoveable") {
Expand Down Expand Up @@ -1714,10 +1711,10 @@ $(function () {
}

var newID = "#" + row + "_" + col;
var lengthOfArray = $(newID).attr("class").split(' ').length;
var lengthOfArray = $(newID)?.attr("class")?.split(' ')?.length ?? 0;
var k = 0;
while (k <= lengthOfArray) {
var cName = $(newID).attr("class").split(' ')[k];
var cName = $(newID)?.attr("class")?.split(' ')?.[k] ?? '';

if (cName == "L_Thesis" || cName == "T_S" || cName == "L_Earned" || cName == "L_Unearned") {
if (box != null) {
Expand Down Expand Up @@ -1756,11 +1753,10 @@ $(function () {
}

var newID = "#" + row + "_" + col;
console.log('here7', row, col, $(newID).attr("class"));
var lengthOfArray = $(newID).attr("class").split(' ').length;
var lengthOfArray = $(newID)?.attr("class")?.split(' ')?.length ?? 0;
var k = 0;
while (k <= lengthOfArray) {
var cName = $(newID).attr("class").split(' ')[k];
var cName = $(newID)?.attr("class")?.split(' ')?.[k] ?? '';

if (cName == "L_DI_CPT" && (typeOfTerm == "O" || typeOfTerm == "X")) {
if (box != null) {
Expand Down

0 comments on commit 80baac8

Please sign in to comment.