diff options
author | Raghu Nayyar <hey@raghunayyar.com> | 2016-08-15 00:49:33 +0530 |
---|---|---|
committer | Raghu Nayyar <hey@raghunayyar.com> | 2016-08-15 00:49:33 +0530 |
commit | 7c61fa14ae4866b7e90a3bf5d8c9f2f664f20833 (patch) | |
tree | 8f5afab84c0ec70b26090e6abccf7a2112045344 /settings | |
parent | eeee9681d5e764454bd26de0a0036992140fc0a0 (diff) | |
download | nextcloud-server-7c61fa14ae4866b7e90a3bf5d8c9f2f664f20833.tar.gz nextcloud-server-7c61fa14ae4866b7e90a3bf5d8c9f2f664f20833.zip |
Fixes image preview when fetched from the store.
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/apps.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index d2411197c9c..f8ad9c7918c 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -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(); }; @@ -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; }, |