Revision 69fb3dbb
Added by Andreas Kohlbecker over 6 years ago
modules/cdm_dataportal/includes/pages.inc | ||
---|---|---|
995 | 995 |
. font_awesome_icon_markup('fa-chevron-right') |
996 | 996 |
. ' </span>'; |
997 | 997 |
$more_children_icon = font_awesome_icon_markup('fa-sitemap fa-rotate-270'); |
998 |
$more_children_label = '...'; |
|
998 | 999 |
|
999 | 1000 |
$items[] = $node_name; |
1000 | 1001 |
|
... | ... | |
1036 | 1037 |
// add more button to the end |
1037 | 1038 |
if(!$parent_taxon_nodes) { |
1038 | 1039 |
// not taxon focused yet, adding button to make the root nodes available |
1039 |
$items[] = '<span class="taxonomic-children-button" data-classification-uuid="' . $current_classification_uuid |
|
1040 |
. '" data-rank-limit-uuid="' . $rank_limit_uuid . '" > ' |
|
1041 |
. $more_children_icon |
|
1042 |
. ' </span>'; |
|
1040 |
$items[] = '<span>' |
|
1041 |
. $more_children_icon . ' ' . |
|
1042 |
'<span class="taxonomic-children-button" data-classification-uuid="' . $current_classification_uuid |
|
1043 |
. '" data-rank-limit-uuid="' . $rank_limit_uuid . '" > ' . $more_children_label . '<span>' |
|
1044 |
. '</span>'; |
|
1043 | 1045 |
} else if($more_children_for){ |
1044 | 1046 |
// last parent item has child taxon nodes |
1045 |
$items[] = ' <span class="taxonomic-children-button" data-cdm-taxon-uuid="' .$more_children_for |
|
1046 |
. '" data-cdm-classification-mode="children" >' |
|
1047 |
. $more_children_icon |
|
1048 |
. ' </span>'; |
|
1047 |
$items[] = ' <span>' |
|
1048 |
. $more_children_icon . ' ' . |
|
1049 |
'<span class="taxonomic-children-button" data-cdm-taxon-uuid="' .$more_children_for |
|
1050 |
. '" data-cdm-classification-mode="children" >' . $more_children_label . '</span>' |
|
1051 |
. '</span>'; |
|
1049 | 1052 |
|
1050 | 1053 |
} |
1051 | 1054 |
|
... | ... | |
1054 | 1057 |
return $render_array; |
1055 | 1058 |
} |
1056 | 1059 |
|
1060 |
|
|
1057 | 1061 |
/** |
1058 | 1062 |
* @param $specimen_uuid |
1059 | 1063 |
* @return array |
modules/cdm_dataportal/js/jquery.cdm.taxonomic_children.js | ||
---|---|---|
250 | 250 |
// when using rotate, in IE and edge the child element are also rotated, need to reset child elements. |
251 | 251 |
// this.$element.addClass(this.options.activeClass); |
252 | 252 |
|
253 |
this.$element.append(this.container); |
|
253 |
this.container.hide(); |
|
254 |
if(!this.container.parent() || this.container.parent().length == 0){ |
|
255 |
// first time this container is used |
|
256 |
this.$element.append(this.container); |
|
257 |
} |
|
254 | 258 |
|
255 | 259 |
this.baseHeight = this.$element.parent().height(); |
256 | 260 |
this.lineHeight = this.$element.parent().css('line-height').replace('px', ''); // TODO use regex fur replace |
... | ... | |
273 | 277 |
plugin.handleDataLoaded(html); |
274 | 278 |
}); |
275 | 279 |
} else { |
280 |
this.container.slideDown(); |
|
276 | 281 |
this.adjustHeight(); |
277 | 282 |
this.scrollToSelected(); |
278 | 283 |
} |
... | ... | |
280 | 285 |
|
281 | 286 |
hideChildren: function(){ |
282 | 287 |
//return; // uncomment for debugging |
283 |
this.container |
|
284 |
.detach();
|
|
288 |
this.container.slideUp();
|
|
289 |
//this.container.detach();
|
|
285 | 290 |
}, |
286 | 291 |
|
287 | 292 |
handleDataLoaded: function(html){ |
... | ... | |
294 | 299 |
// necessary in case of compose_classification_selector |
295 | 300 |
listContainer = listContainer.children('ul'); |
296 | 301 |
} |
302 |
this.container.hide(); |
|
297 | 303 |
this.children.append(listContainer); |
298 | 304 |
this.itemsCount = listContainer.children().length; |
299 | 305 |
|
306 |
this.container.show(); |
|
300 | 307 |
this.adjustHeight(); |
301 | 308 |
this.scrollToSelected(); |
302 | 309 |
}, |
... | ... | |
330 | 337 |
|
331 | 338 |
scrollToSelected: function () { |
332 | 339 |
|
340 |
// first reset the scroll position to 0 so that all calculation are using the same reference position |
|
341 |
this.container.scrollTop(0); |
|
333 | 342 |
var scrollTarget = this.children.find(".focused"); |
334 |
if(scrollTarget){ |
|
343 |
if(scrollTarget && scrollTarget.length > 0){
|
|
335 | 344 |
var position = scrollTarget.position(); |
336 | 345 |
if(position == undefined){ |
337 | 346 |
// fix for IE >= 9 and Edge |
... | ... | |
393 | 402 |
} |
394 | 403 |
} |
395 | 404 |
|
396 |
|
|
397 |
|
|
398 | 405 |
this.log("contentRequest: " + contentRequest); |
399 | 406 |
|
400 | 407 |
var proxyRequest = this.options.proxyRequest |
Also available in: Unified diff
ref #5956 improving classification breadcrumb nav