Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
verona-modules-aspect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IQB
verona-modules-aspect
Commits
f79e4d2c
Commit
f79e4d2c
authored
3 years ago
by
jojohoch
Browse files
Options
Downloads
Patches
Plain Diff
[player] Hide magnifier when mouse is not over image.
The magnifier is always visible in the editor
parent
de3be1d8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/common/element-components/image.component.ts
+6
-2
6 additions, 2 deletions
projects/common/element-components/image.component.ts
projects/common/element-components/magnifier.component.ts
+2
-2
2 additions, 2 deletions
projects/common/element-components/magnifier.component.ts
with
8 additions
and
4 deletions
projects/common/element-components/image.component.ts
+
6
−
2
View file @
f79e4d2c
...
...
@@ -8,13 +8,16 @@ import { ValueChangeElement } from '../models/uI-element';
template
:
`
<div [style.display]="'flex'"
[style.height.%]="100"
[style.width.%]="100">
[style.width.%]="100"
(mouseover)="magnifierVisible = true"
(mouseenter)="magnifierVisible = true"
(mouseleave)="magnifierVisible = false">
<div class="image-container">
<img #image
[src]="elementModel.src | safeResourceUrl"
[alt]="'imageNotFound' | translate"
[class]="elementModel.dynamicPositioning? 'dynamic-image' : 'static-image'">
<app-magnifier *ngIf="elementModel.magnifier"
<app-magnifier *ngIf="elementModel.magnifier
&& ( magnifierVisible || project === 'editor')
"
[imageId]="elementModel.id"
[size]="elementModel.magnifierSize"
[zoom]="elementModel.magnifierZoom"
...
...
@@ -33,5 +36,6 @@ import { ValueChangeElement } from '../models/uI-element';
})
export
class
ImageComponent
extends
ElementComponent
{
@
Output
()
elementValueChanged
=
new
EventEmitter
<
ValueChangeElement
>
();
magnifierVisible
=
false
;
elementModel
!
:
ImageElement
;
}
This diff is collapsed.
Click to expand it.
projects/common/element-components/magnifier.component.ts
+
2
−
2
View file @
f79e4d2c
...
...
@@ -43,8 +43,8 @@ export class Magnifier {
this
.
used
=
true
;
this
.
elementValueChanged
.
emit
({
id
:
this
.
imageId
,
values
:
[
false
,
true
]
});
}
this
.
left
=
this
.
calculateGlassPosition
(
this
.
image
.
width
,
event
.
offsetX
);
this
.
top
=
this
.
calculateGlassPosition
(
this
.
image
.
height
,
event
.
offsetY
);
this
.
left
=
this
.
calculateGlassPosition
(
this
.
image
.
width
,
event
.
offsetX
)
-
1
;
this
.
top
=
this
.
calculateGlassPosition
(
this
.
image
.
height
,
event
.
offsetY
)
-
1
;
this
.
backgroundPosition
=
`-
${
this
.
calculateBackgroundPosition
(
this
.
image
.
width
,
event
.
offsetX
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment