Activate cached themes on desktop set of application path
This commit is contained in:
@@ -13,7 +13,8 @@ module.exports = function(grunt) {
|
||||
|
||||
js: {
|
||||
files: ['app/assets/javascripts/**/*.js'],
|
||||
tasks: [ 'concat:app', 'babel', 'browserify', 'concat:dist', 'clean'],
|
||||
tasks: ['haml', 'ngtemplates', 'sass', 'concat:app', 'babel', 'browserify',
|
||||
'concat:lib', 'concat:dist', 'concat:css', 'uglify', 'ngconstant:build', 'clean'],
|
||||
options: {
|
||||
spawn: false,
|
||||
},
|
||||
|
||||
@@ -154,6 +154,7 @@ class DesktopManager {
|
||||
/* Used to resolve "sn://" */
|
||||
desktop_setApplicationDataPath(path) {
|
||||
this.applicationDataPath = path;
|
||||
this.$rootScope.$broadcast("desktop-did-set-application-path");
|
||||
}
|
||||
|
||||
desktop_setComponentInstallationSyncHandler(handler) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class ThemeManager {
|
||||
|
||||
constructor(componentManager, desktopManager, storageManager, passcodeManager) {
|
||||
constructor(componentManager, desktopManager, storageManager, passcodeManager, $rootScope) {
|
||||
this.componentManager = componentManager;
|
||||
this.storageManager = storageManager;
|
||||
this.desktopManager = desktopManager;
|
||||
@@ -17,11 +17,13 @@ class ThemeManager {
|
||||
this.cacheThemes();
|
||||
})
|
||||
|
||||
// The desktop application won't have its applicationDataPath until the angular document is ready,
|
||||
// so it wont be able to resolve local theme urls until thats ready
|
||||
angular.element(document).ready(() => {
|
||||
if(desktopManager.isDesktop) {
|
||||
$rootScope.$on("desktop-did-set-application-path", () => {
|
||||
this.activateCachedThemes();
|
||||
})
|
||||
} else {
|
||||
this.activateCachedThemes();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
activateCachedThemes() {
|
||||
|
||||
18
dist/javascripts/compiled.js
vendored
18
dist/javascripts/compiled.js
vendored
@@ -58896,6 +58896,7 @@ function () {
|
||||
key: "desktop_setApplicationDataPath",
|
||||
value: function desktop_setApplicationDataPath(path) {
|
||||
this.applicationDataPath = path;
|
||||
this.$rootScope.$broadcast("desktop-did-set-application-path");
|
||||
}
|
||||
}, {
|
||||
key: "desktop_setComponentInstallationSyncHandler",
|
||||
@@ -61723,9 +61724,9 @@ angular.module('app').service('syncManager', SyncManager);
|
||||
var ThemeManager =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
ThemeManager.$inject = ["componentManager", "desktopManager", "storageManager", "passcodeManager"];
|
||||
ThemeManager.$inject = ["componentManager", "desktopManager", "storageManager", "passcodeManager", "$rootScope"];
|
||||
|
||||
function ThemeManager(componentManager, desktopManager, storageManager, passcodeManager) {
|
||||
function ThemeManager(componentManager, desktopManager, storageManager, passcodeManager, $rootScope) {
|
||||
var _this89 = this;
|
||||
|
||||
(0, _classCallCheck3["default"])(this, ThemeManager);
|
||||
@@ -61740,12 +61741,15 @@ function () {
|
||||
|
||||
passcodeManager.addPasscodeChangeObserver(function () {
|
||||
_this89.cacheThemes();
|
||||
}); // The desktop application won't have its applicationDataPath until the angular document is ready,
|
||||
// so it wont be able to resolve local theme urls until thats ready
|
||||
|
||||
angular.element(document).ready(function () {
|
||||
_this89.activateCachedThemes();
|
||||
});
|
||||
|
||||
if (desktopManager.isDesktop) {
|
||||
$rootScope.$on("desktop-did-set-application-path", function () {
|
||||
_this89.activateCachedThemes();
|
||||
});
|
||||
} else {
|
||||
this.activateCachedThemes();
|
||||
}
|
||||
}
|
||||
|
||||
(0, _createClass3["default"])(ThemeManager, [{
|
||||
|
||||
2
dist/javascripts/compiled.min.js
vendored
2
dist/javascripts/compiled.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user