Commit 18ceb705 authored by Kevin CORNILLEAU's avatar Kevin CORNILLEAU

displayPictureTitle v1.0.1: support des images sans title, correction du bug ldleman/Leed-market#65

parent 3349de69
......@@ -4,15 +4,16 @@
@author Kvnco <kvnco@laposte.net>
@link https://twitter.com/kvnco
@licence CC by 3.0 http://creativecommons.org/licenses/by/3.0/fr/
@version 1.0
@version 1.0.1
@description Permet d'afficher en dessous d'une image le texte apparaissant dans la basile title (utile pour les terminaux tactiles)
*/
function displayPictureTitle(&$event){
echo "<script>
var picts = document.getElementById('".$event->getId()."').getElementsByTagName('img');
for (var i = 0; i < picts.length; i++) {
picts[i].insertAdjacentHTML('afterend', '<div class=\'img-title\'>' + picts[i].title + '</div>');
for (var i = 0; i < picts.length; i++) {
if (picts[i].title)
picts[i].insertAdjacentHTML('afterend', '<div class=\'img-title\'>' + picts[i].title + '</div>');
}
</script>";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment