forked from khoanguyen123/aurelia-ui-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-viewport.js
70 lines (70 loc) · 3.46 KB
/
ui-viewport.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
define(["require", "exports", "aurelia-framework", "aurelia-router", "../utils/ui-event", "../utils/ui-utils", "../utils/ui-application"], function (require, exports, aurelia_framework_1, aurelia_router_1, ui_event_1, ui_utils_1, ui_application_1) {
"use strict";
var UIViewport = (function () {
function UIViewport(element, appState, container) {
this.element = element;
this.appState = appState;
this.subtitle = '';
this.copyright = '';
this.showMenu = true;
this.showTaskbar = true;
ui_utils_1.UIUtils.container(container);
this.appState.info(this.constructor.name, "UIViewport Created");
}
UIViewport.prototype.bind = function () {
this.showMenu = isTrue(this.showMenu);
this.showTaskbar = isTrue(this.showTaskbar);
};
UIViewport.prototype.__showMenu = function ($event) {
$event.stopPropagation();
this.element.classList.add('show-menu');
this.appState.info(this.constructor.name, "showMenu");
};
UIViewport.prototype.__hideMenu = function ($event) {
if (this.element.classList.contains('show-menu')) {
this.appState.info(this.constructor.name, "hideMenu");
this.element.classList.remove('show-menu');
}
return true;
};
UIViewport.prototype.logout = function () {
this.appState.info(this.constructor.name, "fire logout event");
ui_event_1.UIEvent.fireEvent('logout', this.element);
};
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', aurelia_router_1.Router)
], UIViewport.prototype, "router", void 0);
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', String)
], UIViewport.prototype, "subtitle", void 0);
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', String)
], UIViewport.prototype, "copyright", void 0);
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', Boolean)
], UIViewport.prototype, "showMenu", void 0);
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', Boolean)
], UIViewport.prototype, "showTaskbar", void 0);
UIViewport = __decorate([
aurelia_framework_1.customElement('ui-viewport'),
__metadata('design:paramtypes', [Element, ui_application_1.UIApplication, aurelia_framework_1.Container])
], UIViewport);
return UIViewport;
}());
exports.UIViewport = UIViewport;
});