Add decorator option for language links

Callback function to be called when a language link is prepared
Can be used for custom decoration.
Arguments:
(a) the $language - the language link jQuery object
(b) languageCode

The function can do any styling, changing properites etc on the passed link.
See examples/decorator.html for example usage.

Change-Id: I5a67654440a07cf7dfac683e22dcb5000ded0bfe
This commit is contained in:
Santhosh Thottingal
2014-09-22 12:32:05 +05:30
parent f2e00432ce
commit 7346469e20
4 changed files with 51 additions and 4 deletions

View File

@@ -246,7 +246,9 @@
a.className = 'autonym';
li.appendChild( a );
if( this.options.languageDecorator ) {
this.options.languageDecorator( $( a ), code );
}
return li;
},
@@ -386,7 +388,8 @@
$.fn.lcd.defaults = {
languages: null,
showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA'],
itemsPerColumn: 8
itemsPerColumn: 8,
languageDecorator: null
};
$.fn.lcd.Constructor = LanguageCategoryDisplay;