Skip to content

Commit

Permalink
Several fixes for issues when embedding `ili to other pages
Browse files Browse the repository at this point in the history
  • Loading branch information
iprotsyuk committed May 17, 2017
1 parent 96d0091 commit 6f3e25c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
<meta name="google-site-verification" content="cxpSm-lsEATF7z2pMt1-RCZPSaKRzb6h0RiIjaVQvsE" />
</head>
<body>
<div id="ili-container"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion js/ViewGroup3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function(THREE, Scene3D, View3D, SpotLabel3D, SpotsController) {

this._div.addEventListener('mousedown', this._onMouseDown.bind(this));

var divs = this._div.querySelectorAll('.View3d');

This comment has been minimized.

Copy link
@iprotsyuk

iprotsyuk May 17, 2017

Author Member

@ElDeveloper the main issue with `ili initialization was here. Surprisingly enough, query selectors seem to be case-insensitive on Windows, which is not the case on macOS.

var divs = this._div.querySelectorAll('.View3D');
for (var i = 0; i < divs.length; i++) {
this._views.push(new View3D(this, divs[i]));
}
Expand Down
2 changes: 1 addition & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ require.config({
});

require(['main'], function (ili) {
var app = new ili(document.getElementById('ili-container'));
var app = new ili(document.getElementsByTagName('body')[0]);
});
4 changes: 3 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ function (Workspace, ViewContainer, ViewGroup3D, MapSelector, ColorMap, saveAs,
alert('WebGL technology is not enabled in your browser. Turn it on to get `ili functioning properly.');
}

this._appContainer = appContainer;
this._appContainer = document.createElement('div');
this._appContainer.id = 'ili-container';
this._appContainer.innerHTML = appLayout;
appContainer.appendChild(this._appContainer);

this._spotsController = new SpotsController();
this._workspace = new Workspace(this._spotsController);
Expand Down
2 changes: 2 additions & 0 deletions layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#ili-container > .row {
margin-left: 0;
margin-right: 0;
height: 100%;
}

#ili-container > .row > * {
padding: 0;
height: 100%;
}

.tab-pane:not(.active) {
Expand Down

0 comments on commit 6f3e25c

Please sign in to comment.