Update to add viewAjaxCallback on every parts that use ajax loading

This commit is contained in:
Wu Cheng-Han 2016-07-02 16:16:22 +08:00
parent 4734d0ebe1
commit e8f59c1df8
1 changed files with 4 additions and 2 deletions

View File

@ -213,6 +213,7 @@ function finishView(view) {
var thumbnail_src = data[0].thumbnail_large; var thumbnail_src = data[0].thumbnail_large;
var image = '<img src="' + thumbnail_src + '" />'; var image = '<img src="' + thumbnail_src + '" />';
$(value).prepend(image); $(value).prepend(image);
if(viewAjaxCallback) viewAjaxCallback();
} }
}); });
}); });
@ -334,8 +335,7 @@ function finishView(view) {
} }
var clone = $value.clone(); var clone = $value.clone();
clone[0].onload = function (e) { clone[0].onload = function (e) {
if(viewAjaxCallback) if(viewAjaxCallback) viewAjaxCallback();
viewAjaxCallback();
}; };
a.html(clone); a.html(clone);
$value.replaceWith(a); $value.replaceWith(a);
@ -371,6 +371,7 @@ function finishView(view) {
var ratio = (height / width) * 100; var ratio = (height / width) * 100;
inner.css('padding-bottom', ratio + '%'); inner.css('padding-bottom', ratio + '%');
$(value).html(inner).append(caption); $(value).html(inner).append(caption);
if(viewAjaxCallback) viewAjaxCallback();
} }
}); });
}); });
@ -402,6 +403,7 @@ function finishView(view) {
var ratio = (height / width) * 100; var ratio = (height / width) * 100;
inner.css('padding-bottom', ratio + '%'); inner.css('padding-bottom', ratio + '%');
$(value).html(inner); $(value).html(inner);
if(viewAjaxCallback) viewAjaxCallback();
} }
}); });
}); });