From b3c5aaa7940387b6d792eac58ed0b10d98a46a68 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Mon, 9 Feb 2015 15:54:39 -0500 Subject: [PATCH] VIVO-904: the display limit annotation on data and faux properties now determines when the more... link is employed for one of these properties. Regular object properties will have a default limit of 5. Also, the add statement link is no longer suppressed when the display limit is reached. --- productMods/js/individual/individualUtils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/productMods/js/individual/individualUtils.js b/productMods/js/individual/individualUtils.js index 8cc1c1c3..31658fc7 100644 --- a/productMods/js/individual/individualUtils.js +++ b/productMods/js/individual/individualUtils.js @@ -1,7 +1,7 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ $(document).ready(function(){ - + // ensures proper layout when an organization has its webpage link displayed as a thumnail. // there's a timing issue, so we can't check the length here, so check the role just to see // if $('ul.webpages-withThumnails') exists @@ -48,7 +48,8 @@ $(document).ready(function(){ // var $propList = $('.property-list').not('>li>ul'); var $propList = $('.property-list:not(:has(>li>ul))'); $propList.each(function() { - var $additionalItems = $(this).find('li:gt(4)'); + var limit = $(this).attr("displayLimit"); + var $additionalItems = $(this).find('li:gt(' + (limit - 1) + ')'); if ( $additionalItems.exists() ) { // create container for additional elements var $itemContainer = $('
').appendTo(this); @@ -66,7 +67,8 @@ $(document).ready(function(){ var $subPropList = $('.subclass-property-list'); $subPropList.each(function() { - var $additionalItems = $(this).find('li:gt(4)'); + var limit = $(this).parent().parent().attr("displayLimit"); + var $additionalItems = $(this).find('li:gt(' + (limit - 1) + ')'); if ( $additionalItems.exists() ) { // create container for additional elements var $itemContainer = $('
').appendTo(this);