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
cc34f247
Commit
cc34f247
authored
9 months ago
by
rhenck
Browse files
Options
Downloads
Patches
Plain Diff
Audio, Image: Make position prop optional
For Table compatibility.
parent
c96e2f7a
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/models/elements/media-elements/audio.ts
+5
-6
5 additions, 6 deletions
projects/common/models/elements/media-elements/audio.ts
projects/common/models/elements/media-elements/image.ts
+4
-5
4 additions, 5 deletions
projects/common/models/elements/media-elements/image.ts
with
9 additions
and
11 deletions
projects/common/models/elements/media-elements/audio.ts
+
5
−
6
View file @
cc34f247
...
...
@@ -5,7 +5,7 @@ import {
import
{
ElementComponent
}
from
'
common/directives/element-component.directive
'
;
import
{
AudioComponent
}
from
'
common/components/media-elements/audio.component
'
;
import
{
PositionProperties
,
PropertyGroupGenerators
,
PropertyGroupValidators
PositionProperties
,
PropertyGroupGenerators
}
from
'
common/models/elements/property-group-interfaces
'
;
import
{
environment
}
from
'
common/environment
'
;
import
{
InstantiationEror
}
from
'
common/util/errors
'
;
...
...
@@ -13,7 +13,7 @@ import { InstantiationEror } from 'common/util/errors';
export
class
AudioElement
extends
PlayerElement
implements
AudioProperties
{
type
:
UIElementType
=
'
audio
'
;
src
:
string
|
null
=
null
;
position
:
PositionProperties
;
position
?
:
PositionProperties
;
styling
:
{
backgroundColor
:
string
};
static
title
:
string
=
'
Audio
'
;
...
...
@@ -23,7 +23,7 @@ export class AudioElement extends PlayerElement implements AudioProperties {
super
(
element
);
if
(
element
&&
isValid
(
element
))
{
this
.
src
=
element
.
src
;
this
.
position
=
{
...
element
.
position
};
if
(
element
.
position
)
this
.
position
=
{
...
element
.
position
};
this
.
styling
=
{
...
element
.
styling
};
}
else
{
if
(
environment
.
strictInstantiation
)
{
...
...
@@ -57,13 +57,12 @@ export class AudioElement extends PlayerElement implements AudioProperties {
export
interface
AudioProperties
extends
PlayerElementBlueprint
{
src
:
string
|
null
;
position
:
PositionProperties
;
position
?
:
PositionProperties
;
styling
:
{
backgroundColor
:
string
};
}
function
isValid
(
blueprint
?:
AudioProperties
):
boolean
{
if
(
!
blueprint
)
return
false
;
return
blueprint
.
src
!==
undefined
&&
blueprint
.
styling
?.
backgroundColor
!==
undefined
&&
PropertyGroupValidators
.
isValidPosition
(
blueprint
.
position
);
blueprint
.
styling
?.
backgroundColor
!==
undefined
;
}
This diff is collapsed.
Click to expand it.
projects/common/models/elements/media-elements/image.ts
+
4
−
5
View file @
cc34f247
...
...
@@ -20,7 +20,7 @@ export class ImageElement extends UIElement implements ImageProperties {
magnifierSize
:
number
=
100
;
magnifierZoom
:
number
=
1.5
;
magnifierUsed
:
boolean
=
false
;
position
:
PositionProperties
;
position
?
:
PositionProperties
;
static
title
:
string
=
'
Bild
'
;
static
icon
:
string
=
'
image
'
;
...
...
@@ -35,7 +35,7 @@ export class ImageElement extends UIElement implements ImageProperties {
this
.
magnifierSize
=
element
.
magnifierSize
;
this
.
magnifierZoom
=
element
.
magnifierZoom
;
this
.
magnifierUsed
=
element
.
magnifierUsed
;
this
.
position
=
{
...
element
.
position
};
if
(
element
.
position
)
this
.
position
=
{
...
element
.
position
};
}
else
{
if
(
environment
.
strictInstantiation
)
{
throw
new
InstantiationEror
(
'
Error at Image instantiation
'
,
element
);
...
...
@@ -98,7 +98,7 @@ export interface ImageProperties extends UIElementProperties {
magnifierSize
:
number
;
magnifierZoom
:
number
;
magnifierUsed
:
boolean
;
position
:
PositionProperties
;
position
?
:
PositionProperties
;
}
function
isValid
(
blueprint
?:
ImageProperties
):
boolean
{
...
...
@@ -109,6 +109,5 @@ function isValid(blueprint?: ImageProperties): boolean {
blueprint
.
magnifier
!==
undefined
&&
blueprint
.
magnifierSize
!==
undefined
&&
blueprint
.
magnifierZoom
!==
undefined
&&
blueprint
.
magnifierUsed
!==
undefined
&&
PropertyGroupValidators
.
isValidPosition
(
blueprint
.
position
);
blueprint
.
magnifierUsed
!==
undefined
;
}
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