MDL-70106 cache: Set icon localstorage cache to use theme localisation
authorPeter Burnett <peterburnett@catalyst-au.net>
Tue, 3 Nov 2020 00:59:21 +0000 (10:59 +1000)
committerPeter Burnett <peterburnett@catalyst-au.net>
Wed, 4 Nov 2020 03:33:23 +0000 (13:33 +1000)
lib/amd/build/icon_system_fontawesome.min.js
lib/amd/build/icon_system_fontawesome.min.js.map
lib/amd/src/icon_system_fontawesome.js

index 47c4244..10ffe0b 100644 (file)
Binary files a/lib/amd/build/icon_system_fontawesome.min.js and b/lib/amd/build/icon_system_fontawesome.min.js differ
index 1bb4e1d..374c798 100644 (file)
Binary files a/lib/amd/build/icon_system_fontawesome.min.js.map and b/lib/amd/build/icon_system_fontawesome.min.js.map differ
index 25c749c..39c4711 100644 (file)
@@ -42,11 +42,13 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals
      * @return {Promise}
      */
     IconSystemFontawesome.prototype.init = function() {
+        var currTheme = M.cfg.theme;
+
         if (staticMap) {
             return $.when(this);
         }
 
-        var map = LocalStorage.get('core/iconmap-fontawesome');
+        var map = LocalStorage.get('core_iconsystem/theme/' + currTheme + '/core/iconmap-fontawesome');
         if (map) {
             map = JSON.parse(map);
         }
@@ -70,7 +72,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals
             $.each(map, function(index, value) {
                 staticMap[value.component + '/' + value.pix] = value.to;
             });
-            LocalStorage.set('core/iconmap-fontawesome', JSON.stringify(staticMap));
+            LocalStorage.set('core_iconsystem/theme/' + currTheme + '/core/iconmap-fontawesome', JSON.stringify(staticMap));
             return this;
         }.bind(this));
     };