Skip to content

Commit

Permalink
Use both lang and clan (content lang) in JS Ajax request
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Jan 11, 2020
1 parent 5b11e33 commit bbd9876
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions resource/js/docready.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ $(function() { // DOCUMENT READY
};

// Defined in scripts.js. Will load the mapping properties via Ajax request to JSKOS REST service, and render them.
loadMappingProperties(concept, clang, $conceptAppendix, data);
loadMappingProperties(concept, lang, clang, $conceptAppendix, data);
} else {
makeCallbacks(data);
}
Expand Down Expand Up @@ -1123,7 +1123,7 @@ $(function() { // DOCUMENT READY
};

// Defined in scripts.js. Will load the mapping properties via Ajax request to JSKOS REST service, and render them.
loadMappingProperties(concept, clang, $conceptAppendix, null);
loadMappingProperties(concept, lang, clang, $conceptAppendix, null);
} else {
makeCallbacks();
}
Expand Down
7 changes: 4 additions & 3 deletions resource/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,19 @@ function renderPropertyMappings(concept, contentLang, properties) {
* template is comprised of another template, for concept mapping property values.
*
* @param concept dictionary/object populated with data from the Concept object
* @param contentLang language to display content
* @param lang language used in the UI
* @param contentLang the content language
* @param $htmlElement HTML (a div) parent object (initially hidden)
* @param conceptData concept page data returned via ajax, passed to makeCallback only
*/
function loadMappingProperties(concept, contentLang, $htmlElement, conceptData) {
function loadMappingProperties(concept, lang, contentLang, $htmlElement, conceptData) {
// display with the spinner
$htmlElement
.removeClass('hidden')
.append('<div class="spinner row"></div>');
$.ajax({
url: rest_base_url + vocab + '/mappings',
data: $.param({'uri': concept.uri, lang: contentLang}),
data: $.param({'uri': concept.uri, lang: lang, clang: contentLang}),
success: function(data) {

// The JSKOS REST mapping properties call will have added more resources into the graph. The graph
Expand Down

0 comments on commit bbd9876

Please sign in to comment.