Make js/inline-expanding.js better, now that post images are marked with .post-image

This commit is contained in:
Michael Foster 2013-08-16 22:02:57 +10:00
parent aaeac9de3c
commit 23f23b8301

View File

@ -16,10 +16,7 @@ onready(function(){
var link = this.getElementsByTagName('a');
for (var i = 0; i < link.length; i++) {
if (typeof link[i] == "object" && link[i].childNodes && typeof link[i].childNodes[0] !== 'undefined' && link[i].childNodes[0].src && link[i].className != 'file') {
if (window.jQuery && !$(link).prev().hasClass('fileinfo')) {
continue;
}
if (typeof link[i] == "object" && link[i].childNodes && typeof link[i].childNodes[0] !== 'undefined' && link[i].childNodes[0].src && link[i].childNodes[0].className.match(/post-image/)) {
link[i].childNodes[0].style.maxWidth = '95%';
link[i].onclick = function(e) {
if (this.childNodes[0].className == 'hidden')