aboutsummaryrefslogtreecommitdiffstats
path: root/js/asset-viewer.js
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-12-30 15:55:13 -0500
committerJesús <heckyel@hyperbola.info>2019-12-30 15:55:13 -0500
commit288df6a7bf8b933e2dc499e38f4915fcf974c14b (patch)
tree77bba994f260c064d3ee7f76c427ddfaa4f91710 /js/asset-viewer.js
parenta2c9deaa145b780722e93b3899600f287c8094a4 (diff)
downloadematrix-288df6a7bf8b933e2dc499e38f4915fcf974c14b.tar.lz
ematrix-288df6a7bf8b933e2dc499e38f4915fcf974c14b.tar.xz
ematrix-288df6a7bf8b933e2dc499e38f4915fcf974c14b.zip
backport
- Flush caches on upgrade - Properly handle FrameModule's unloading - Use the new module and remove the old implementation
Diffstat (limited to 'js/asset-viewer.js')
-rw-r--r--js/asset-viewer.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/js/asset-viewer.js b/js/asset-viewer.js
index 1d88459..0185ff1 100644
--- a/js/asset-viewer.js
+++ b/js/asset-viewer.js
@@ -23,25 +23,20 @@
'use strict';
-/******************************************************************************/
-
(function() {
-
- var onAssetContentReceived = function(details) {
+ let onAssetContentReceived = function (details) {
document.getElementById('content').textContent =
details && (details.content || '');
};
- var q = window.location.search;
- var matches = q.match(/^\?url=([^&]+)/);
- if ( !matches || matches.length !== 2 ) {
+ let q = window.location.search;
+ let matches = q.match(/^\?url=([^&]+)/);
+ if (!matches || matches.length !== 2) {
return;
}
- vAPI.messaging.send(
- 'asset-viewer.js',
- { what : 'getAssetContent', url: matches[1] },
- onAssetContentReceived
- );
-
+ vAPI.messaging.send('asset-viewer.js', {
+ what : 'getAssetContent',
+ url: matches[1]
+ }, onAssetContentReceived);
})();