Skip to content

Commit

Permalink
Rename "fullOrWidget" parameter to "scope"
Browse files Browse the repository at this point in the history
  • Loading branch information
kimrutherford committed Oct 17, 2024
1 parent da1ecc1 commit f3971de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions protein_feature_view/templates/protein_feature_view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@

<script language="javascript" type="text/javascript">
const geneUniquename = '{{gene_uniquename}}';
const fullOrWidget = '{{full_or_widget}}';
const scope = '{{scope}}';

function noData() {
document.getElementById('pfv').innerHTML = '<div class="no-features">No features available for ' + geneUniquename + '</div>';
}

window.onload = (event) => {

fetch("/api/v1/dataset/latest/protein_features/" + fullOrWidget + "/" + geneUniquename)
fetch("/api/v1/dataset/latest/protein_features/" + scope + "/" + geneUniquename)
.then((response) => {
return response.json();
})
Expand Down Expand Up @@ -180,7 +180,7 @@
colour: '#f94',
allowGaps: true,
helpText: '<div>Positions where there are one or more amino acid substitutions</div>' +
(fullOrWidget == 'widget' ? '<div>Visit the full feature viewer to see allele details</div>' : ''),
(scope == 'widget' ? '<div>Visit the full feature viewer to see allele details</div>' : ''),
singular: 'AA substitution position',
},
'AA substitution alleles': {
Expand Down Expand Up @@ -390,7 +390,7 @@

let trackHeight = 20;

if (fullOrWidget == 'widget' && track.name != 'Modifications') {
if (scope == 'widget' && track.name != 'Modifications') {
trackHeight = 25;
}

Expand Down Expand Up @@ -431,7 +431,7 @@

const tooltips = {};

const trackWidth = fullOrWidget == 'widget' ? 770 : 970;
const trackWidth = scope == 'full' ? 970 : 650;

const boardConfigData = {
length: data.sequence.length,
Expand Down
4 changes: 2 additions & 2 deletions protein_feature_view/views.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.shortcuts import render

def index(request):
full_or_widget = request.GET.get('full_or_widget', '').strip()
scope = request.GET.get('scope', '').strip()
gene_uniquename = request.GET.get('gene_uniquename', '').strip()

context = {
'full_or_widget': full_or_widget,
'scope': scope,
'gene_uniquename': gene_uniquename
}

Expand Down

0 comments on commit f3971de

Please sign in to comment.