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

datatables for mocha installed

parent cce2b4c7
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -16,6 +16,7 @@
"bootstrap": "^3.3.7",
"browserify": "^13.1.1",
"chai": "^3.5.0",
"datatables.net": "^1.10.13",
"exorcist": "^0.4.0",
"file-url": "^2.0.0",
"jquery": "3.1.1",
......
"use strict";
/* exported logger */
var AbstractGuiElement = require('./AbstractGuiElement');
var GuiConnector = require('../GuiConnector');
var functions = require('../functions');
var logger = require('../logger');
function PublicationListDialog(params) {
AbstractGuiElement.call(this, params);
var self = this;
$(self.getElement()).dialog({
autoOpen : false,
resizable : false,
});
}
PublicationListDialog.prototype = Object.create(AbstractGuiElement.prototype);
PublicationListDialog.prototype.constructor = PublicationListDialog;
PublicationListDialog.prototype.show = function() {
var self = this;
$(self.getElement()).dialog("open");
};
PublicationListDialog.prototype.destroy = function() {
$(this.getElement()).dialog("destroy");
};
module.exports = PublicationListDialog;
"use strict";
/* exported logger */
var AbstractGuiElement = require('./AbstractGuiElement');
var GuiConnector = require('../GuiConnector');
var Functions = require('../functions');
var logger = require('../logger');
function PublicationListDialog(params) {
AbstractGuiElement.call(this, params);
var self = this;
self.createPublicationListDialogGui();
$(self.getElement()).dialog({
autoOpen : false,
resizable : false,
});
}
PublicationListDialog.prototype = Object.create(AbstractGuiElement.prototype);
PublicationListDialog.prototype.constructor = PublicationListDialog;
PublicationListDialog.prototype.createPublicationListDialogGui = function() {
var self = this;
var head = Functions.createElement({
type : "thead",
content : "<tr><th>Pubmed ID</th></tr>"
});
var body = Functions.createElement({
type : "tbody",
content : "<tr><td>1234</td></tr><tr><td>2</td></tr><tr><td>4</td></tr>"
});
var tableElement = Functions.createElement({
type : "table",
style : "width: 100%",
});
tableElement.appendChild(head);
tableElement.appendChild(body);
self.tableElement = tableElement;
self.getElement().appendChild(tableElement);
};
PublicationListDialog.prototype.show = function() {
var self = this;
$(self.getElement()).dialog("open");
if (!$.fn.DataTable.isDataTable(self.tableElement)) {
$(self.tableElement).dataTable();
}
};
PublicationListDialog.prototype.destroy = function() {
$(this.getElement()).dialog("destroy");
};
module.exports = PublicationListDialog;
......@@ -18,7 +18,7 @@ describe('ProjectInfoPanel', function() {
});
it('contructor', function() {
var div = document.createElement("div");
var div = testDiv;
var map = helper.createCustomMap();
......@@ -30,7 +30,7 @@ describe('ProjectInfoPanel', function() {
});
it('refresh', function() {
var div = document.createElement("div");
var div = testDiv;
var panel = new ProjectInfoPanel({
element : div,
customMap : helper.createCustomMap(),
......@@ -41,7 +41,7 @@ describe('ProjectInfoPanel', function() {
});
it('download source', function() {
var div = document.createElement("div");
var div = testDiv;
var panel = new ProjectInfoPanel({
element : div,
customMap : helper.createCustomMap(),
......@@ -50,7 +50,7 @@ describe('ProjectInfoPanel', function() {
});
it('show publication list', function() {
var div = document.createElement("div");
var div = testDiv;
var panel = new ProjectInfoPanel({
element : div,
customMap : helper.createCustomMap(),
......
......@@ -16,10 +16,14 @@ global.$ = require('jQuery');
global.jQuery = $;
global.window.$ = $;
global.Option = window.Option;
require('jquery-ui-dist/jquery-ui.js');
require("bootstrap");
require('datatables.net')(window, $);
global.google = require('./google-map-mock');
global.GuiConnector = require('./GuiConnector-mock');
......
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