jQuery.telligent.evolution.ui.components.collapseexpand
UI Component which handles presentation of content that can be collapsed and expanded. Overrides can be provided at the theme level to present bookmarks differently.
Options
Data made available to instances of the component:
collapsetext
: (string) Text label when content can be collapsedexpandtext
: (string) Text label when content can be expanded
Default Implementation
For reference purposes or as the basis for an override:
$.telligent.evolution.ui.components.collapseexpand = {
setup: function() {
},
add: function(elm, options) {
var a = $('<a></a>').attr({href: '#'}).text(options.collapsetext);
var isExpanded = false;
a.on('click', function() {
if(isExpanded) {
elm.slideUp();
a.text(options.collapsetext);
}
else {
elm.slideDown();
a.text(options.expandtext);
}
isExpanded = !isExpanded;
return false;
});
elm.removeClass().before(a).hide();
}
};