Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
pub
frama-c
Commits
4479219b
Commit
4479219b
authored
4 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[dome] suppress deprecated module
Replaced by AutoSize from react-virtualized
parent
ef0146b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ivette/src/dome/src/misc/layout.js
+0
-71
0 additions, 71 deletions
ivette/src/dome/src/misc/layout.js
with
0 additions
and
71 deletions
ivette/src/dome/src/misc/layout.js
deleted
100644 → 0
+
0
−
71
View file @
ef0146b1
// --------------------------------------------------------------------------
// --- A Ghost Component aware of its enclosing positionned container
// --------------------------------------------------------------------------
import
React
from
'
react
'
;
const
SIZED
=
{
display
:
'
block
'
,
position
:
'
absolute
'
,
top
:
0
,
left
:
0
,
height
:
'
100%
'
,
width
:
'
100%
'
,
overflow
:
'
hidden
'
,
pointerEvents
:
'
none
'
,
zIndex
:
-
1
};
// --------------------------------------------------------------------------
// --- Components
// --------------------------------------------------------------------------
/*
This component is a ghost element to be inserted inside a _positionned_
container. It makes the container aware of its bounding client rectangle
_via_ the `onResize` property.
The `onResize` callback is invoked whenever the parent container is
positionned or resized. The callback is passed the
`container.getBoundingClientRect()` rectangle.
*/
export
class
Layout
extends
React
.
Component
{
// Init the element
componentDidMount
()
{
this
.
element
.
data
=
'
about:blank
'
;
this
.
handleResize
=
this
.
handleResize
.
bind
(
this
);
}
// Callback on Resize
handleResize
()
{
if
(
this
.
props
.
onResize
)
{
const
r
=
this
.
element
.
getBoundingClientRect
();
this
.
props
.
onResize
(
r
);
}
}
componentWillUnmount
()
{
if
(
this
.
state
.
view
)
this
.
state
.
view
.
removeEventListener
(
'
resize
'
,
this
.
handleResize
);
}
render
()
{
return
React
.
createElement
(
'
object
'
,
{
type
:
'
text/html
'
,
style
:
SIZED
,
ref
:
elt
=>
{
this
.
element
=
elt
;
},
onLoad
:
evt
=>
{
this
.
setState
(
{
view
:
evt
.
target
.
contentDocument
.
defaultView
},
()
=>
{
this
.
state
.
view
.
addEventListener
(
'
resize
'
,
this
.
handleResize
);
this
.
handleResize
();
}
);
}
});
}
}
// --------------------------------------------------------------------------
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