Add fallback for failed app logo rendering

This commit is contained in:
theworldbright 2015-11-22 14:42:54 -08:00
parent fd4022a55c
commit 7e8bd0f411
4 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
$(document).ready(function() {
$("#js-app-logo").error(function () {
$(this).attr("src", ImagePaths.get("user/default.png"));
});
});

View file

@ -45,3 +45,4 @@
//= require bootstrap-switch
//= require blueimp-gallery
//= require leaflet
//= require api/authorization_page

View file

@ -1,6 +1,6 @@
.application-img
- if app.image
= image_tag app.image, class: "img-responsive"
= image_tag app.image, class: "img-responsive", id: "js-app-logo"
- else
%i.entypo-browser
.application-authorizations

View file

@ -1,6 +1,6 @@
.application-img
- if app.image
= image_tag app.image, class: "img-responsive"
= image_tag app.image, class: "img-responsive", id: "js-app-logo"
- else
%i.entypo-browser
.application-authorizations