UI: widget fullscreen mode improvement

This commit is contained in:
Igor Kulikov 2017-02-14 17:07:10 +02:00
parent 7f5407db70
commit f27349ff95
2 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,7 @@
<li gridster-item="vm.currentWidgetItemMap" ng-repeat="widget in vm.widgets"> <li gridster-item="vm.currentWidgetItemMap" ng-repeat="widget in vm.widgets">
<md-menu md-position-mode="target target" tb-mousepoint-menu> <md-menu md-position-mode="target target" tb-mousepoint-menu>
<div tb-expand-fullscreen <div tb-expand-fullscreen
fullscreen-background-style="vm.dashboardStyle"
expand-button-id="expand-button" expand-button-id="expand-button"
on-fullscreen-changed="vm.onWidgetFullscreenChanged(expanded, widget)" on-fullscreen-changed="vm.onWidgetFullscreenChanged(expanded, widget)"
layout="column" layout="column"

View File

@ -50,6 +50,7 @@ function ExpandFullscreen($compile, $document) {
scope.elementParent = null; scope.elementParent = null;
scope.expanded = false; scope.expanded = false;
scope.fullscreenZindex = scope.fullscreenZindex(); scope.fullscreenZindex = scope.fullscreenZindex();
if (!scope.fullscreenZindex) { if (!scope.fullscreenZindex) {
scope.fullscreenZindex = '70'; scope.fullscreenZindex = '70';
} }
@ -59,6 +60,10 @@ function ExpandFullscreen($compile, $document) {
if (scope.expanded) { if (scope.expanded) {
scope.elementParent = element.parent(); scope.elementParent = element.parent();
element.detach(); element.detach();
if (scope.backgroundStyle) {
scope.fullscreenParent.attr("ng-style","backgroundStyle");
$compile(scope.fullscreenParent)(scope);
}
scope.fullscreenParent.append(element); scope.fullscreenParent.append(element);
scope.fullscreenParent.css('display', ''); scope.fullscreenParent.css('display', '');
scope.fullscreenParent.css('z-index', scope.fullscreenZindex); scope.fullscreenParent.css('z-index', scope.fullscreenZindex);
@ -132,7 +137,8 @@ function ExpandFullscreen($compile, $document) {
expand: "&tbExpandFullscreen", expand: "&tbExpandFullscreen",
hideExpandButton: "&hideExpandButton", hideExpandButton: "&hideExpandButton",
onFullscreenChanged: "&onFullscreenChanged", onFullscreenChanged: "&onFullscreenChanged",
fullscreenZindex: "&fullscreenZindex" fullscreenZindex: "&fullscreenZindex",
backgroundStyle: "=?fullscreenBackgroundStyle"
} }
}; };
} }