Skip to content

Commit 1e531fd

Browse files
committed
fix overflow problem for on creating a panel
1 parent 65b1bd9 commit 1e531fd

File tree

9 files changed

+27
-9
lines changed

9 files changed

+27
-9
lines changed

dist/css/worldmap-panel.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.mapcontainer {
2+
overflow: hidden;
3+
}
4+
15
.info {
26
padding: 6px 8px;
37
font: 14px/16px Arial, Helvetica, sans-serif;

dist/map_renderer.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/map_renderer.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/worldmap.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/worldmap.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint:watch": "onchange 'src/**/*.js' -- npm run lint",
1010
"build": "grunt",
1111
"prebuild": "npm run lint && npm run clean",
12-
"build:watch": "onchange './src/**/*.js' './src/plugin.json' -- npm run build",
12+
"build:watch": "onchange './src/**/*.js' './src/**/*.css' './src/**/*.html' './src/plugin.json' -- npm run build",
1313
"test:watch": "karma start",
1414
"test": "karma start --single-run"
1515
},

src/css/worldmap-panel.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.mapcontainer {
2+
overflow: hidden;
3+
}
4+
15
.info {
26
padding: 6px 8px;
37
font: 14px/16px Arial, Helvetica, sans-serif;

src/map_renderer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import './css/leaflet.css!';
22
import WorldMap from './worldmap';
33

44
export default function link(scope, elem, attrs, ctrl) {
5-
const mapContainer = elem.find('.mapcontainer');
6-
75
ctrl.events.on('render', () => {
86
render();
97
ctrl.renderingCompleted();
@@ -12,6 +10,12 @@ export default function link(scope, elem, attrs, ctrl) {
1210
function render() {
1311
if (!ctrl.data) return;
1412

13+
const mapContainer = elem.find('.mapcontainer');
14+
15+
if (mapContainer[0].id.indexOf('{{') > -1) {
16+
return;
17+
}
18+
1519
if (!ctrl.map) {
1620
ctrl.map = new WorldMap(ctrl, mapContainer[0]);
1721
}

src/worldmap.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ export default class WorldMap {
1212
constructor(ctrl, mapContainer) {
1313
this.ctrl = ctrl;
1414
this.mapContainer = mapContainer;
15-
this.createMap();
1615
this.circles = [];
16+
17+
return this.createMap();
1718
}
1819

1920
createMap() {

0 commit comments

Comments
 (0)