Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Override padding style from VS Code to match AtlasMap one #69
Browse files Browse the repository at this point in the history
it allows to take the whole space in UI

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
  • Loading branch information
apupier committed Feb 21, 2019
1 parent c533ce0 commit 7b0ac33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/atlasMapWebView.ts
Expand Up @@ -90,8 +90,9 @@ export default class AtlasMapPanel {
fetchUrl(url, function(error, meta, body) {
try {
var content = body.toString();
content = body.toString().replace('href="/"', 'href="'+url+'/"');
AtlasMapPanel.currentPanel._panel.webview.html = content;
var contentWithHrefFullySpecified = content.replace('href="/"', 'href="'+url+'/"');
var contentWithHrefFullySpecifiedAndCSS = contentWithHrefFullySpecified.replace('<body>', '<body style="padding: 0">');
AtlasMapPanel.currentPanel._panel.webview.html = contentWithHrefFullySpecifiedAndCSS;
} catch (err) {
console.error(err);
}
Expand Down
5 changes: 5 additions & 0 deletions src/test/command.start.test.ts
@@ -1,11 +1,13 @@
"use strict";

import * as atlasMapWebView from "../atlasMapWebView";
import * as chai from "chai";
import * as child_process from 'child_process';
import * as sinon from "sinon";
import * as sinonChai from "sinon-chai";
import * as testUtils from "./command.test.utils";
import * as vscode from "vscode";
import { BrowserType } from "../utils";

const expect = chai.expect;
chai.use(sinonChai);
Expand Down Expand Up @@ -116,6 +118,9 @@ testUtils.BROWSER_TYPES.forEach(function (browserConfig) {
await testUtils.getWebUI(url)
.then( (body) => {
expect(body, "Unexpected html response body").to.contain("AtlasMap");
if (browserConfig === BrowserType.Internal) {
expect(atlasMapWebView.default.currentPanel._panel.webview.html).to.contain(url).and.to.contain('<body style="padding: 0">');
}
done();
})
.catch( (err) => {
Expand Down

0 comments on commit 7b0ac33

Please sign in to comment.