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

touch interface params moved to minerva.create

parent 056d4dd6
No related branches found
No related tags found
1 merge request!7Resolve "info about loading data from server"
......@@ -232,8 +232,19 @@ function getProject(params) {
}
};
function create(params) {
function modifyParamsForTouchInterface(params) {
if (params.markerOptimization === undefined && params.bigLogo === undefined
&& params.customTouchInterface === undefined) {
var windowsTouchInterface = ((navigator.appVersion.indexOf("Win") != -1) && ('ontouchstart' in document.documentElement));
params.markerOptimization = !windowsTouchInterface;
params.bigLogo = windowsTouchInterface;
params.customTouchInterface = windowsTouchInterface;
}
return params;
}
function create(params) {
params = modifyParamsForTouchInterface(params);
var customMap;
var leftPanel;
var topMenu;
......
......@@ -230,6 +230,7 @@ describe('minerva global', function() {
projectId : "sample",
element : testDiv
};
logger.debug(options);
return minerva.create(options).then(function(result) {
assert.ok(result);
});
......
......@@ -7,7 +7,10 @@ var Helper = require('./Helper');
// GLOBAL configuration
global.navigator = {
userAgent : 'node.js'
userAgent : 'node.js',
appName : 'MinervaUnitTest',
appVersion : '0.0.1',
};
var jsdom = require('jsdom');
......
......@@ -33,12 +33,8 @@
function initMap(){
var element = document.getElementById('minervaAppDiv');
var windowsTouchInterface = ((navigator.appVersion.indexOf("Win")!=-1) && ('ontouchstart' in document.documentElement));
return minerva.create({
element : element,
markerOptimization : !windowsTouchInterface,
bigLogo : windowsTouchInterface,
customTouchInterface: windowsTouchInterface,
}).then(function(result){
customMap = result;
document.title = result.getProject().getName();
......
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