authorship removal VIVO-891 and allowed concept classes being passed as array instead of hardcoded
This commit is contained in:
parent
a35e3fb4f5
commit
4ad8b4b417
2 changed files with 10 additions and 9 deletions
|
@ -53,7 +53,8 @@
|
|||
editMode: 'add',
|
||||
typeName: 'Concept',
|
||||
defaultTypeName: 'concept', // used in repair mode to generate button text
|
||||
baseHref: '${urls.base}/individual?uri='
|
||||
baseHref: '${urls.base}/individual?uri=',
|
||||
limitToConceptClasses:["http://www.w3.org/2004/02/skos/core#Concept"]
|
||||
};
|
||||
var i18nStrings = {
|
||||
selectAnExisting: '${i18n().select_an_existing}',
|
||||
|
|
|
@ -113,7 +113,7 @@ var addAuthorForm = {
|
|||
// after hitting 'cancel.'
|
||||
initAuthorListOnlyView: function() {
|
||||
|
||||
if ($('.authorship').length) { // make sure we have at least one author
|
||||
if ($('li.authorship').length) { // make sure we have at least one author
|
||||
// Reorder authors on page load so that previously unranked authors get a rank. Otherwise,
|
||||
// when we add a new author, it will get put ahead of any previously unranked authors, instead
|
||||
// of at the end of the list. (It is also helpful to normalize the data before we get started.)
|
||||
|
@ -282,7 +282,7 @@ var addAuthorForm = {
|
|||
setAcFilter: function() {
|
||||
this.acFilter = [];
|
||||
|
||||
$('.authorship').each(function() {
|
||||
$('li.authorship').each(function() {
|
||||
var uri = $(this).data('authorUri');
|
||||
addAuthorForm.acFilter.push(uri);
|
||||
});
|
||||
|
@ -404,7 +404,7 @@ var addAuthorForm = {
|
|||
type: 'POST',
|
||||
success: function(data, status, request) {
|
||||
var pos;
|
||||
$('.authorship').each(function(index){
|
||||
$('li.authorship').each(function(index){
|
||||
pos = index + 1;
|
||||
// Set the new position for this element. The only function of this value
|
||||
// is so we can reset an element to its original position in case reordering fails.
|
||||
|
@ -440,7 +440,7 @@ var addAuthorForm = {
|
|||
// have to keep retrieving data from or modifying the DOM as we manipulate the
|
||||
// authorships.
|
||||
initAuthorshipData: function() {
|
||||
$('.authorship').each(function(index) {
|
||||
$('li.authorship').each(function(index) {
|
||||
$(this).data(authorshipData[index]);
|
||||
|
||||
// RY We might still need position to put back an element after reordering
|
||||
|
@ -462,7 +462,7 @@ var addAuthorForm = {
|
|||
findAuthorship: function(key, value) {
|
||||
var matchingAuthorship = $(); // if we don't find one, return an empty jQuery set
|
||||
|
||||
$('.authorship').each(function() {
|
||||
$('li.authorship').each(function() {
|
||||
var authorship = $(this);
|
||||
if ( authorship.data(key) === value ) {
|
||||
matchingAuthorship = authorship;
|
||||
|
@ -644,7 +644,7 @@ var addAuthorForm = {
|
|||
url: $(link).attr('href'),
|
||||
type: 'POST',
|
||||
data: {
|
||||
deletion: $(link).parents('.authorship').data('authorshipUri')
|
||||
deletion: $(link).parents('li.authorship').data('authorshipUri')
|
||||
},
|
||||
dataType: 'json',
|
||||
context: link, // context for callback
|
||||
|
@ -654,7 +654,7 @@ var addAuthorForm = {
|
|||
|
||||
if (status === 'success') {
|
||||
|
||||
authorship = $(this).parents('.authorship');
|
||||
authorship = $(this).parents('li.authorship');
|
||||
|
||||
// Clear autocomplete cache entries matching this author's name, else
|
||||
// autocomplete will be retrieved from the cache, which excludes the removed author.
|
||||
|
@ -673,7 +673,7 @@ var addAuthorForm = {
|
|||
$(this).remove();
|
||||
|
||||
// Actions that depend on the author having been removed from the DOM:
|
||||
numAuthors = $('.authorship').length; // retrieve the length after removing authorship from the DOM
|
||||
numAuthors = $('li.authorship').length; // retrieve the length after removing authorship from the DOM
|
||||
|
||||
// If removed item not last, reorder to remove any gaps
|
||||
if (numAuthors > 0 && ! removeLast) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue