Skip to content

Commit

Permalink
Fixes image preview when fetched from the store.
Browse files Browse the repository at this point in the history
  • Loading branch information
raghunayyar authored and MorrisJobke committed Aug 17, 2016
1 parent c76f60e commit ff65e0c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions settings/js/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ OC.Settings.Apps = OC.Settings.Apps || {

currentImage.onload = function() {
page.find('.app-image')
.append(OC.Settings.Apps.imageUrl(app.preview))
.append(OC.Settings.Apps.imageUrl(app.preview, app.detailpage))
.fadeIn();
};

Expand Down Expand Up @@ -228,12 +228,18 @@ OC.Settings.Apps = OC.Settings.Apps || {

/**
* Returns the image for apps listing
* url : the url of the image
* appfromstore: bool to check whether the app is fetched from store or not.
*/

imageUrl : function (url) {
imageUrl : function (url, appfromstore) {
var img = '<svg width="72" height="72" viewBox="0 0 72 72">';
img += '<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>';
img += '<image x="0" y="0" width="72" height="72" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + url + '" class="app-icon" /></svg>';
if (appfromstore) {
img += '<image x="0" y="0" width="72" height="72" preserveAspectRatio="xMinYMin meet" xlink:href="' + url + '" class="app-icon" /></svg>';
} else {
img += '<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>';
img += '<image x="0" y="0" width="72" height="72" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + url + '" class="app-icon" /></svg>';
}
return img;
},

Expand Down

0 comments on commit ff65e0c

Please sign in to comment.