diff --git a/frontend-js/src/main/js/minerva.js b/frontend-js/src/main/js/minerva.js index 0f5021796ea16e559074e12cf1ae526af1280ee6..65053b96f2d0c897cbe7ddfaf8ccb089bb4f08e5 100644 --- a/frontend-js/src/main/js/minerva.js +++ b/frontend-js/src/main/js/minerva.js @@ -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; diff --git a/frontend-js/src/test/js/minerva-test.js b/frontend-js/src/test/js/minerva-test.js index d5bc556c8bfc66c1d5ef4d0bdfa67e6bff9e6307..4840d61cef21f0f79dadf6fe4c20e5d30014d6a2 100644 --- a/frontend-js/src/test/js/minerva-test.js +++ b/frontend-js/src/test/js/minerva-test.js @@ -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); }); diff --git a/frontend-js/src/test/js/mocha-config.js b/frontend-js/src/test/js/mocha-config.js index 2141c28dff5690041abf2996c8031b2857771593..9267f8971083fd37b4e436283281ec2d59bea323 100644 --- a/frontend-js/src/test/js/mocha-config.js +++ b/frontend-js/src/test/js/mocha-config.js @@ -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'); diff --git a/web/src/main/webapp/index.xhtml b/web/src/main/webapp/index.xhtml index 260cd314c5c748d4830ab721a6c10bb898d7ca81..009ee0edd0e166bd5e72756f59527b007f160765 100644 --- a/web/src/main/webapp/index.xhtml +++ b/web/src/main/webapp/index.xhtml @@ -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();