Skip to content

Commit

Permalink
SAK-29804 assignments -> update disableControls JavaScript to include…
Browse files Browse the repository at this point in the history
… links by name attribute
  • Loading branch information
bjones86 committed Aug 12, 2015
1 parent a53f444 commit 4014fb4
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 51 deletions.
14 changes: 13 additions & 1 deletion assignment/assignment-tool/tool/src/webapp/js/assignments.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ ASN.toggleElements = function( elements, disabled )
};

// SAK-29314
ASN.disableControls = function( escape )
ASN.disableControls = function( escape, linkName )
{
// Clone and disable all drop downs (disable the clone, hide the original)
var dropDowns = ASN.nodeListToArray( document.getElementsByTagName( "select" ) );
Expand Down Expand Up @@ -616,6 +616,18 @@ ASN.disableControls = function( escape )
ASN.disableLink( links[i] );
}
}

if( linkName !== null )
{
var links = ASN.nodeListToArray( document.getElementsByName( linkName ) );
for( i = 0; i < links.length; i++ )
{
if( links[i] !== null )
{
ASN.disableLink( links[i] );
}
}
}
};

// SAK-29314
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<input type="hidden" name="eventSubmit_doView" value="view" />
<label for="view">$tlang.getString("gen.view2")</label>
<span class="skip">$tlang.getString("newassig.selectmessage")</span>
<select name="view" id="view" size="1" tabindex="3" onchange="ASN.disableControls();ASN.showSpinner( 'viewSpinner' );document.viewFormList.submit();">
<select name="view" id="view" size="1" tabindex="3" onchange="ASN.disableControls( null, 'studentLink' );ASN.showSpinner( 'viewSpinner' );document.viewFormList.submit();">
<option value="lisofass1" >$!tlang.getString('lisofass1')</option>
<option value="lisofass2" selected="selected" >$!tlang.getString('lisofass2')</option>
</select>
Expand All @@ -74,7 +74,7 @@
</div>
<span class="skip">$tlang.getString("newassig.selectmessage")</span>

<select id="viewgroup" name="viewgroup" size="1" tabindex="3" onchange="ASN.disableControls();ASN.showSpinner( 'groupSpinner' );blur();document.getElementById('option').value='changeView';document.viewForm.submit();return false;">
<select id="viewgroup" name="viewgroup" size="1" tabindex="3" onchange="ASN.disableControls( null, 'studentLink' );ASN.showSpinner( 'groupSpinner' );blur();document.getElementById('option').value='changeView';document.viewForm.submit();return false;">

#if (!$showSubmissionByFilterSearchOnly)
<option value="all" #if($!viewGroup.equals("all"))selected="selected"#end >$tlang.getString('gen.viewallgroupssections')</option>
Expand Down Expand Up @@ -144,12 +144,12 @@
<td headers="studentname" class="specialLink">
<h4>
#if (!$studentListShowSet.contains($member.Id))
<a href="#" onclick="ASN.disableControls();ASN.showSpinner( 'userSpinner_$member.Id' );location='#toolLinkParam("AssignmentAction" "doShow_student_submission" "studentId=$validator.escapeUrl($member.Id)")'; return false;"
title="$tlang.getString("stulistsunbm.shostuass")">
<a href="#" onclick="ASN.disableControls( null, 'studentLink' );ASN.showSpinner( 'userSpinner_$member.Id' );location='#toolLinkParam("AssignmentAction" "doShow_student_submission" "studentId=$validator.escapeUrl($member.Id)")'; return false;"
title="$tlang.getString("stulistsunbm.shostuass")" name="studentLink" >
<img src="#imageLink("sakai/expand.gif")" alt="$tlang.getString("stulistsunbm.shostuass")" width="13" height="13" border="0" />
#else
<a href="#" onclick="ASN.disableControls();ASN.showSpinner( 'userSpinner_$member.Id' );location='#toolLinkParam("AssignmentAction" "doHide_student_submission" "studentId=$validator.escapeUrl($member.Id)")'; return false;"
title="$tlang.getString("stulistsunbm.hidstuass")">
<a href="#" onclick="ASN.disableControls( null, 'studentLink' );ASN.showSpinner( 'userSpinner_$member.Id' );location='#toolLinkParam("AssignmentAction" "doHide_student_submission" "studentId=$validator.escapeUrl($member.Id)")'; return false;"
title="$tlang.getString("stulistsunbm.hidstuass")" name="studentLink" >
<img src="#imageLink("sakai/collapse.gif")" alt="$tlang.getString("stulistsunbm.hidstuass")" width="13" height="13" border="0" />
#end
$submitterName
Expand Down Expand Up @@ -183,7 +183,7 @@
#if ($allowAddAssignment && $allowSubmitByInstructor)
#set( $spinnerID = "submitFor_" + $member.Id + "_" + $validator.escapeUrl($assignment.Reference) )
<div class="itemAction">
<a onclick="ASN.disableControls();ASN.showSpinner( '$spinnerID' );" href="#toolLinkParam("AssignmentAction" "doView_submission" "assignmentReference=$validator.escapeUrl($assignment.Reference)&submitterId=$validator.escapeUrl($member.id)")">
<a onclick="ASN.disableControls( null, 'studentLink' );ASN.showSpinner( '$spinnerID' );" href="#toolLinkParam("AssignmentAction" "doView_submission" "assignmentReference=$validator.escapeUrl($assignment.Reference)&submitterId=$validator.escapeUrl($member.id)")">
$tlang.getString("submitforstudent")
</a>
<img id="$spinnerID" class="spinner" src="/library/image/indicator.gif" />
Expand Down
Loading

0 comments on commit 4014fb4

Please sign in to comment.