Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e33c2cd8
Commit
e33c2cd8
authored
Apr 10, 2020
by
Natalia Tepluhina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix leaving annotations on designs not fitting the viewport
parent
c16e2ad6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
2 deletions
+51
-2
ee/app/assets/javascripts/design_management/components/design_presentation.vue
...ipts/design_management/components/design_presentation.vue
+12
-2
ee/changelogs/unreleased/214101-creating-an-annotation-on-the-design-that-is-bigger-that-screen.yml
...n-annotation-on-the-design-that-is-bigger-that-screen.yml
+6
-0
ee/spec/frontend/design_management/components/design_presentation_spec.js
.../design_management/components/design_presentation_spec.js
+33
-0
No files found.
ee/app/assets/javascripts/design_management/components/design_presentation.vue
View file @
e33c2cd8
...
@@ -46,6 +46,7 @@ export default {
...
@@ -46,6 +46,7 @@ export default {
height
:
0
,
height
:
0
,
},
},
initialLoad
:
true
,
initialLoad
:
true
,
startDragPosition
:
null
,
lastDragPosition
:
null
,
lastDragPosition
:
null
,
};
};
},
},
...
@@ -218,10 +219,12 @@ export default {
...
@@ -218,10 +219,12 @@ export default {
onPresentationMousedown
({
clientX
,
clientY
})
{
onPresentationMousedown
({
clientX
,
clientY
})
{
if
(
!
this
.
isDesignOverflowing
())
return
;
if
(
!
this
.
isDesignOverflowing
())
return
;
this
.
las
tDragPosition
=
{
this
.
star
tDragPosition
=
{
x
:
clientX
,
x
:
clientX
,
y
:
clientY
,
y
:
clientY
,
};
};
this
.
lastDragPosition
=
{
...
this
.
startDragPosition
};
},
},
onPresentationMousemove
({
clientX
,
clientY
})
{
onPresentationMousemove
({
clientX
,
clientY
})
{
if
(
!
this
.
lastDragPosition
)
return
;
if
(
!
this
.
lastDragPosition
)
return
;
...
@@ -239,7 +242,14 @@ export default {
...
@@ -239,7 +242,14 @@ export default {
y
:
clientY
,
y
:
clientY
,
};
};
},
},
onPresentationMouseup
()
{
onPresentationMouseup
({
offsetX
,
offsetY
})
{
if
(
this
.
startDragPosition
?.
x
===
this
.
lastDragPosition
?.
x
&&
this
.
startDragPosition
?.
y
===
this
.
lastDragPosition
?.
y
)
{
this
.
openCommentForm
({
x
:
offsetX
,
y
:
offsetY
});
}
this
.
lastDragPosition
=
null
;
this
.
lastDragPosition
=
null
;
},
},
isDesignOverflowing
()
{
isDesignOverflowing
()
{
...
...
ee/changelogs/unreleased/214101-creating-an-annotation-on-the-design-that-is-bigger-that-screen.yml
0 → 100644
View file @
e33c2cd8
---
title
:
Resolve Creating an annotation on the design that is bigger that screen size
is broken
merge_request
:
29351
author
:
type
:
fixed
ee/spec/frontend/design_management/components/design_presentation_spec.js
View file @
e33c2cd8
...
@@ -425,6 +425,39 @@ describe('Design management design presentation component', () => {
...
@@ -425,6 +425,39 @@ describe('Design management design presentation component', () => {
});
});
});
});
describe
(
'
onPresentationMouseUp when design is overflowing
'
,
()
=>
{
it
(
'
does not open a comment form if design was dragged
'
,
()
=>
{
const
startDragPosition
=
{
x
:
1
,
y
:
1
};
const
lastDragPosition
=
{
x
:
2
,
y
:
2
};
createComponent
({},
{
startDragPosition
,
lastDragPosition
});
wrapper
.
vm
.
onPresentationMouseup
({
offsetX
:
2
,
offsetY
:
2
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
(
'
openCommentForm
'
)).
toBeFalsy
();
});
});
it
(
'
opens a comment form if design was not dragged
'
,
()
=>
{
const
startDragPosition
=
{
x
:
1
,
y
:
1
};
const
lastDragPosition
=
{
x
:
1
,
y
:
1
};
createComponent
(
{},
{
startDragPosition
,
lastDragPosition
,
...
mockOverlayData
,
},
);
wrapper
.
vm
.
onPresentationMouseup
({
offsetX
:
2
,
offsetY
:
2
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
(
'
openCommentForm
'
)).
toBeDefined
();
});
});
});
describe
(
'
when clicking and dragging
'
,
()
=>
{
describe
(
'
when clicking and dragging
'
,
()
=>
{
it
.
each
`
it
.
each
`
description | useTouchEvents
description | useTouchEvents
...
...
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