Skip to content

Commit

Permalink
Fix safari layout issue in Visualize, Graph and Lens (elastic#54694)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored and jkelastic committed Jan 17, 2020
1 parent 489ae3f commit 149e5fc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,17 @@ export const renderApp = (element: HTMLElement, appBasePath: string, deps: Rende
};
};

const mainTemplate = (basePath: string) => `<div style="height: 100%">
const mainTemplate = (basePath: string) => `<div ng-view class="kbnLocalApplicationWrapper">
<base href="${basePath}" />
<div ng-view style="height: 100%;"></div>
</div>
`;
</div>`;

const moduleName = 'app/dashboard';

const thirdPartyAngularDependencies = ['ngSanitize', 'ngRoute', 'react'];

function mountDashboardApp(appBasePath: string, element: HTMLElement) {
const mountpoint = document.createElement('div');
mountpoint.setAttribute('style', 'height: 100%');
mountpoint.setAttribute('class', 'kbnLocalApplicationWrapper');
// eslint-disable-next-line
mountpoint.innerHTML = mainTemplate(appBasePath);
// bootstrap angular into detached element and attach it later to
Expand Down
3 changes: 3 additions & 0 deletions src/legacy/core_plugins/kibana/public/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
// Management styles
@import './management/index';

// Local application mount wrapper styles
@import 'local_application_service/index';

// Dashboard styles
// MUST STAY AT THE BOTTOM BECAUSE OF DARK THEME IMPORTS
@import './dashboard/index';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'local_application_service';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.kbnLocalApplicationWrapper {
display: flex;
flex-direction: column;
flex-grow: 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class LocalApplicationService {
outerAngularWrapperRoute: true,
reloadOnSearch: false,
reloadOnUrl: false,
template: `<div style="height:100%" id="${wrapperElementId}"></div>`,
template: `<div class="kbnLocalApplicationWrapper" id="${wrapperElementId}"></div>`,
controller($scope: IScope) {
const element = document.getElementById(wrapperElementId)!;
let unmountHandler: AppUnmount | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ export const renderApp = async (
return () => $injector.get('$rootScope').$destroy();
};

const mainTemplate = (basePath: string) => `<div style="height: 100%">
const mainTemplate = (basePath: string) => `<div ng-view class="kbnLocalApplicationWrapper">
<base href="${basePath}" />
<div ng-view style="height: 100%;"></div>
</div>
`;

Expand All @@ -75,7 +74,7 @@ const thirdPartyAngularDependencies = ['ngSanitize', 'ngRoute', 'react'];

function mountVisualizeApp(appBasePath: string, element: HTMLElement) {
const mountpoint = document.createElement('div');
mountpoint.setAttribute('style', 'height: 100%');
mountpoint.setAttribute('class', 'kbnLocalApplicationWrapper');
mountpoint.innerHTML = mainTemplate(appBasePath);
// bootstrap angular into detached element and attach it later to
// make angular-within-angular possible
Expand Down
5 changes: 2 additions & 3 deletions x-pack/legacy/plugins/graph/public/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ export const renderApp = ({ appBasePath, element, ...deps }: GraphDependencies)
};
};

const mainTemplate = (basePath: string) => `<div style="height: 100%">
const mainTemplate = (basePath: string) => `<div ng-view class="kbnLocalApplicationWrapper">
<base href="${basePath}" />
<div ng-view style="height: 100%; display:flex; justify-content: center;"></div>
</div>
`;

Expand All @@ -108,7 +107,7 @@ const thirdPartyAngularDependencies = ['ngSanitize', 'ngRoute', 'react', 'ui.boo

function mountGraphApp(appBasePath: string, element: HTMLElement) {
const mountpoint = document.createElement('div');
mountpoint.setAttribute('style', 'height: 100%');
mountpoint.setAttribute('class', 'kbnLocalApplicationWrapper');
// eslint-disable-next-line
mountpoint.innerHTML = mainTemplate(appBasePath);
// bootstrap angular into detached element and attach it later to
Expand Down

0 comments on commit 149e5fc

Please sign in to comment.