Skip to content

Commit

Permalink
Avoid overwriting globally scoped variable n
Browse files Browse the repository at this point in the history
Co-authored-by: Guilherme Francisco <[email protected]>
  • Loading branch information
ndg63276 and gfrn authored Sep 12, 2023
1 parent 7777ae5 commit 24197da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/src/js/modules/dc/views/gridplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ define(['jquery', 'marionette',

populateImageSelect: function() {
opts = []
for (n=1; n<=4; n++) {
if (this.getOption('parent').get('X'+n)) {
opts.push('<option value='+n+'>Image '+n+'</option>')
if (n == 1) {
for (let i=1; i<=4; i++) {
if (this.getOption('parent').get('X'+i)) {
opts.push('<option value='+i+'>Image '+i+'</option>')
if (i === 1) {
// show button to view image full size
this.ui.sns.append('<a class="button" href="'+app.apiurl+'/image/id/'+this.getOption('ID')+'/f/1/n/'+n+'"><i class="fa fa-arrows"></a>')
this.ui.sns.append('<a class="button" href="'+app.apiurl+'/image/id/'+this.getOption('ID')+'/f/1/n/'+i+'"><i class="fa fa-arrows"></a>')
} else {
this.ui.sns.append('<a class="hidden" href="'+app.apiurl+'/image/id/'+this.getOption('ID')+'/f/1/n/'+n+'"></a>')
this.ui.sns.append('<a class="hidden" href="'+app.apiurl+'/image/id/'+this.getOption('ID')+'/f/1/n/'+i+'"></a>')
}
}
}
Expand Down

0 comments on commit 24197da

Please sign in to comment.