Functioning UI
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
import {
|
||||
import {
|
||||
SNApplication,
|
||||
SNAlertManager,
|
||||
Platforms
|
||||
} from 'snjs';
|
||||
import angular from 'angular';
|
||||
import { AlertManager } from '@/services/alertManager';
|
||||
Environments,
|
||||
platformFromString
|
||||
} from 'snjs';
|
||||
import angular from 'angular';
|
||||
import { getPlatformString } from '@/utils';
|
||||
import { AlertManager } from '@/services/alertManager';
|
||||
|
||||
import { WebDeviceInterface } from '@/web_device_interface';
|
||||
|
||||
export class Application extends SNApplication {
|
||||
constructor(
|
||||
desktopManager
|
||||
) {
|
||||
constructor() {
|
||||
const deviceInterface = new WebDeviceInterface();
|
||||
super({
|
||||
platform: Platforms.Web,
|
||||
environment: Environments.Web,
|
||||
platform: platformFromString(getPlatformString()),
|
||||
namespace: '',
|
||||
host: window._default_sync_server,
|
||||
deviceInterface: deviceInterface,
|
||||
@@ -25,30 +26,26 @@ export class Application extends SNApplication {
|
||||
}
|
||||
]
|
||||
});
|
||||
this.desktopManager = desktopManager;
|
||||
deviceInterface.setApplication(this);
|
||||
this.overrideComponentManagerFunctions();
|
||||
}
|
||||
|
||||
overrideComponentManagerFunctions() {
|
||||
function openModalComponent(component) {
|
||||
var scope = this.$rootScope.$new(true);
|
||||
const scope = this.$rootScope.$new(true);
|
||||
scope.component = component;
|
||||
var el = this.$compile("<component-modal component='component' class='sk-modal'></component-modal>")(scope);
|
||||
const el = this.$compile("<component-modal component='component' class='sk-modal'></component-modal>")(scope);
|
||||
angular.element(document.body).append(el);
|
||||
}
|
||||
|
||||
function presentPermissionsDialog(dialog) {
|
||||
const scope = this.$rootScope.$new(true);
|
||||
scope.permissionsString = dialog.permissionsString;
|
||||
scope.component = dialog.component;
|
||||
scope.callback = dialog.callback;
|
||||
|
||||
var el = this.$compile("<permissions-modal component='component' permissions-string='permissionsString' callback='callback' class='sk-modal'></permissions-modal>")(scope);
|
||||
const el = this.$compile("<permissions-modal component='component' permissions-string='permissionsString' callback='callback' class='sk-modal'></permissions-modal>")(scope);
|
||||
angular.element(document.body).append(el);
|
||||
}
|
||||
|
||||
this.componentManager.openModalComponent = openModalComponent;
|
||||
this.componentManager.presentPermissionsDialog = presentPermissionsDialog;
|
||||
this.componentManager.setDesktopManager(this.desktopManager);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user