Skip to content
Snippets Groups Projects
Commit 1bece762 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

submap panel is generated via javascript

parent aaa3eb8c
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -29,6 +29,10 @@ var PanelControlElementType = {
USER_TAB_SURNAME_TEXT : "USER_TAB_SURNAME_TEXT",
USER_TAB_EMAIL_TEXT : "USER_TAB_EMAIL_TEXT",
USER_TAB_LOGOUT_BUTTON : "USER_TAB_LOGOUT_BUTTON",
SUBMAP_TABLE : "SUBMAP_TABLE",
SUBMAP_DIV : "SUBMAP_DIV",
};
module.exports = PanelControlElementType;
......@@ -3,28 +3,53 @@
/* exported logger */
var Panel = require('./Panel');
var PanelControlElementType = require('./PanelControlElementType');
var logger = require('../logger');
var Functions = require('../Functions');
function SubmapPanel(params) {
params.panelName = "user";
Panel.call(this, params);
var self = this;
self._createSubmapGui();
self.refresh();
}
SubmapPanel.prototype = Object.create(Panel.prototype);
SubmapPanel.prototype.constructor = SubmapPanel;
SubmapPanel.prototype.getSubmapTable = function() {
return this.getElementByName(this.getElement(), "submapTable");
SubmapPanel.prototype._createSubmapGui = function() {
var submapDiv = Functions.createElement({
type : "div",
name : "submapDiv",
className : "searchPanel"
});
this.getElement().appendChild(submapDiv);
this.setControlElement(PanelControlElementType.SUBMAP_DIV, submapDiv);
var generalOverlaysTitle = Functions.createElement({
type : "h5",
content : "SUBMAPS:"
});
submapDiv.appendChild(generalOverlaysTitle);
var submapTableDiv = Functions.createElement({
type : "table",
name : "submapTable",
className : "table table-bordered",
style : "width:100%"
});
submapDiv.appendChild(submapTableDiv);
this.setControlElement(PanelControlElementType.SUBMAP_TABLE, submapTableDiv);
};
SubmapPanel.prototype.refresh = function() {
var self = this;
var table = self.getSubmapTable();
var table = self.getControlElement(PanelControlElementType.SUBMAP_TABLE);
while (table.lastChild) {
table.removeChild(table.lastChild);
}
......
......@@ -18,7 +18,7 @@ describe('SubmapPanel', function() {
});
it('contructor', function() {
var div = helper.createSubmapTab();
var div = document.createElement("div");
var map = helper.createCustomMap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment