Skip to content

Commit

Permalink
extract template
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Jan 23, 2018
1 parent 6f969e3 commit c7c9ff1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
11 changes: 11 additions & 0 deletions src/core_plugins/tagcloud/public/tag_cloud_container.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="tagcloud-vis">
<div class="tagcloud-custom-label"></div>
<div class="tagcloud-notifications">
<div class="tagcloud-truncated-message">
The number of tags has been truncated to avoid long draw times.
</div>
<div class="tagcloud-incomplete-message">
The container is too small to display the entire cloud. Tags might be cropped or omitted.
</div>
</div>
</div>
17 changes: 3 additions & 14 deletions src/core_plugins/tagcloud/public/tag_cloud_visualization.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import TagCloud from 'plugins/tagcloud/tag_cloud';
import TagCloud from './tag_cloud';
import tagCloudContainer from './tag_cloud_container.html';
import { Observable } from 'rxjs';

const MAX_TAG_COUNT = 200;
Expand All @@ -9,19 +10,7 @@ export class TagCloudVisualization {
this._containerNode = node;

const nodeContents = document.createElement('div');
nodeContents.innerHTML = `
<div class="tagcloud-vis">
<div class="tagcloud-custom-label"></div>
<div class="tagcloud-notifications">
<div class="tagcloud-truncated-message">
The number of tags has been truncated to avoid long draw times.
</div>
<div class="tagcloud-incomplete-message">
The container is too small to display the entire cloud. Tags might be cropped or omitted.
</div>
</div>
</div>
`;
nodeContents.innerHTML = tagCloudContainer;
this._containerNode.appendChild(nodeContents);

this._vis = vis;
Expand Down

0 comments on commit c7c9ff1

Please sign in to comment.