Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
a3a70e07
Commit
a3a70e07
authored
Jul 20, 2018
by
Piotr Gawron
Browse files
when submap is opened it takes background from top map
parent
2a65dc71
Pipeline
#5876
passed with stage
in 1 minute and 56 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/map/Submap.js
View file @
a3a70e07
...
@@ -83,6 +83,7 @@ Submap.prototype.open = function (htmlTag) {
...
@@ -83,6 +83,7 @@ Submap.prototype.open = function (htmlTag) {
self
.
_createMapChangedCallbacks
();
self
.
_createMapChangedCallbacks
();
self
.
getMapCanvas
().
triggerListeners
(
'
resize
'
);
self
.
getMapCanvas
().
triggerListeners
(
'
resize
'
);
self
.
getMapCanvas
().
setBackgroundId
(
self
.
getTopMap
().
getBackgroundDataOverlay
().
getId
());
self
.
initialized
=
true
;
self
.
initialized
=
true
;
}
else
{
}
else
{
...
...
frontend-js/src/test/js/map/Submap-test.js
View file @
a3a70e07
...
@@ -23,23 +23,44 @@ describe('Submap', function () {
...
@@ -23,23 +23,44 @@ describe('Submap', function () {
assert
.
equal
(
logger
.
getErrors
().
length
,
0
);
assert
.
equal
(
logger
.
getErrors
().
length
,
0
);
});
});
it
(
"
open
"
,
function
()
{
describe
(
"
open
"
,
function
()
{
var
map
=
helper
.
createCustomMap
();
it
(
"
default
"
,
function
()
{
var
map
=
helper
.
createCustomMap
();
var
model
=
helper
.
createModel
();
var
model
=
helper
.
createModel
();
var
submap
=
new
Submap
(
map
,
model
);
var
submap
=
new
Submap
(
map
,
model
);
$
(
testDiv
).
dialog
({
$
(
testDiv
).
dialog
({
autoOpen
:
false
autoOpen
:
false
});
});
submap
.
open
(
testDiv
);
submap
.
open
(
testDiv
);
$
(
testDiv
).
dialog
(
"
destroy
"
);
$
(
testDiv
).
dialog
(
"
destroy
"
);
assert
.
ok
(
submap
);
assert
.
ok
(
submap
);
assert
.
equal
(
logger
.
getWarnings
().
length
,
0
);
assert
.
equal
(
logger
.
getWarnings
().
length
,
0
);
assert
.
equal
(
logger
.
getErrors
().
length
,
0
);
assert
.
equal
(
logger
.
getErrors
().
length
,
0
);
});
it
(
"
with different background
"
,
function
()
{
var
map
,
submap
;
var
projectId
=
"
complex_model_with_submaps
"
;
helper
.
setUrl
(
"
http://test/?id=
"
+
projectId
);
return
ServerConnector
.
getProject
(
projectId
).
then
(
function
(
project
)
{
map
=
helper
.
createCustomMap
(
project
);
submap
=
map
.
getSubmapById
(
16729
);
return
project
.
getDataOverlayById
(
14960
)
}).
then
(
function
(
dataOverlay
)
{
return
map
.
openDataOverlay
(
dataOverlay
);
}).
then
(
function
()
{
return
submap
.
open
(
testDiv
);
}).
then
(
function
()
{
assert
.
equal
(
map
.
getMapCanvas
().
getBackgroundId
(),
submap
.
getMapCanvas
().
getBackgroundId
(),
"
Background on top map different from submap
"
);
}).
finally
(
function
()
{
return
submap
.
destroy
();
});
});
});
});
it
(
"
getTopMap
"
,
function
()
{
it
(
"
getTopMap
"
,
function
()
{
...
@@ -72,7 +93,7 @@ describe('Submap', function () {
...
@@ -72,7 +93,7 @@ describe('Submap', function () {
return
marker
.
init
();
return
marker
.
init
();
}).
then
(
function
()
{
}).
then
(
function
()
{
assert
.
ok
(
marker
.
getAliasData
());
assert
.
ok
(
marker
.
getAliasData
());
}).
finally
(
function
(){
}).
finally
(
function
()
{
return
submap
.
destroy
();
return
submap
.
destroy
();
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment