Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-web
ensembl-client
Commits
ca036e8c
Commit
ca036e8c
authored
Feb 04, 2019
by
Imran Salam
Browse files
add missing styling added by Dan for browser and refactor BrowserImage
parent
dcb3c024
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
src/ensembl/src/content/app/browser/Browser.scss
src/ensembl/src/content/app/browser/Browser.scss
+1
-0
src/ensembl/src/content/app/browser/browser-image/BrowserImage.scss
...l/src/content/app/browser/browser-image/BrowserImage.scss
+5
-0
src/ensembl/src/content/app/browser/browser-image/BrowserImage.tsx
...bl/src/content/app/browser/browser-image/BrowserImage.tsx
+16
-11
No files found.
src/ensembl/src/content/app/browser/Browser.scss
View file @
ca036e8c
...
...
@@ -6,6 +6,7 @@
.browserInnerWrapper
{
@include
flex
;
height
:
calc
(
100%
-
40px
);
}
.browserImageWrapper
{
...
...
src/ensembl/src/content/app/browser/browser-image/BrowserImage.scss
0 → 100644
View file @
ca036e8c
.browserStage
{
width
:
100%
;
height
:
calc
(
100%
-
45px
);
overflow
:
hidden
;
}
src/ensembl/src/content/app/browser/browser-image/BrowserImage.tsx
View file @
ca036e8c
import
React
,
{
PureComponent
}
from
'
react
'
;
import
styles
from
'
./BrowserImage.scss
'
;
type
BrowserImageProps
=
{};
class
BrowserImage
extends
PureComponent
<
BrowserImageProps
>
{
...
...
@@ -11,7 +13,16 @@ class BrowserImage extends PureComponent<BrowserImageProps> {
this
.
browserCanvas
=
React
.
createRef
();
}
activate_if_possible
(
currentEl
:
HTMLElement
|
null
)
{
public
componentDidMount
()
{
const
currentEl
=
this
.
browserCanvas
.
current
;
this
.
activateIfPossible
(
currentEl
);
}
public
render
()
{
return
<
div
className
=
{
styles
.
browserStage
}
ref
=
{
this
.
browserCanvas
}
/>;
}
private
activateIfPossible
(
currentEl
:
HTMLElement
|
null
)
{
const
activateEvent
=
new
CustomEvent
(
'
bpane-activate
'
,
{
bubbles
:
true
,
detail
:
{
...
...
@@ -20,30 +31,24 @@ class BrowserImage extends PureComponent<BrowserImageProps> {
});
let
done
=
false
;
if
(
currentEl
&&
currentEl
.
ownerDocument
)
{
const
browserEl
=
currentEl
.
ownerDocument
.
querySelector
(
'
.browser-stage
'
)
as
HTMLBodyElement
;
const
bodyEl
=
currentEl
.
ownerDocument
.
querySelector
(
'
body
'
);
if
(
bodyEl
&&
bodyEl
.
classList
.
contains
(
'
browser-app-ready
'
))
{
browserEl
.
dispatchEvent
(
activateEvent
);
done
=
true
;
}
}
if
(
!
done
)
{
setTimeout
(()
=>
this
.
activate
_if_p
ossible
(
currentEl
),
50
);
setTimeout
(()
=>
this
.
activate
IfP
ossible
(
currentEl
),
50
);
}
}
public
componentDidMount
()
{
const
currentEl
=
this
.
browserCanvas
.
current
;
this
.
activate_if_possible
(
currentEl
);
}
public
render
()
{
return
<
div
className
=
"browser-stage"
ref
=
{
this
.
browserCanvas
}
/>;
}
}
export
default
BrowserImage
;
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