From 288df6a7bf8b933e2dc499e38f4915fcf974c14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Mon, 30 Dec 2019 15:55:13 -0500 Subject: backport - Flush caches on upgrade - Properly handle FrameModule's unloading - Use the new module and remove the old implementation --- js/asset-viewer.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'js/asset-viewer.js') 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); })(); -- cgit v1.2.3