Batch of fixes for Safari (#2025)

* Styles fixes

* Fixed imageBitmap & styles on annotation page

* Increased version of cvat-data
main
Boris Sekachev 6 years ago committed by GitHub
parent 0856be00e9
commit d66449241a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
{
"name": "cvat-data",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "cvat-data",
"version": "1.0.0",
"version": "1.0.1",
"description": "",
"main": "src/js/cvat-data.js",
"devDependencies": {

@ -295,7 +295,26 @@ class FrameProvider {
worker.terminate();
};
worker.onmessage = (event) => {
worker.onmessage = async (event) => {
if (event.data.isRaw) {
// safary doesn't support createImageBitmap
// there is a way to polyfill it with using document.createElement
// but document.createElement doesn't work in worker
// so, we get raw data and decode it here, no other way
const createImageBitmap = async function(blob) {
return new Promise((resolve,reject) => {
let img = document.createElement('img');
img.addEventListener('load', function() {
resolve(this);
});
img.src = URL.createObjectURL(blob);
});
};
event.data.data = await createImageBitmap(event.data.data);
}
this._frames[event.data.index] = event.data.data;
if (this._decodingBlocks[`${start}:${end}`].resolveCallback) {

@ -20,13 +20,22 @@ onmessage = (e) => {
const fileIndex = index++;
if (fileIndex <= end) {
_zip.file(relativePath).async('blob').then((fileData) => {
createImageBitmap(fileData).then((img) => {
if (self.createImageBitmap) {
createImageBitmap(fileData).then((img) => {
postMessage({
fileName: relativePath,
index: fileIndex,
data: img,
});
});
} else {
postMessage({
fileName: relativePath,
index: fileIndex,
data: img,
data: fileData,
isRaw: true,
});
});
}
});
}
});

@ -80,17 +80,17 @@ export default function AnnotationPageComponent(props: Props): JSX.Element {
<AnnotationTopBarContainer />
</Layout.Header>
{ workspace === Workspace.STANDARD && (
<Layout.Content>
<Layout.Content style={{ height: '100%' }}>
<StandardWorkspaceComponent />
</Layout.Content>
)}
{ workspace === Workspace.ATTRIBUTE_ANNOTATION && (
<Layout.Content>
<Layout.Content style={{ height: '100%' }}>
<AttributeAnnotationWorkspace />
</Layout.Content>
)}
{ workspace === Workspace.TAG_ANNOTATION && (
<Layout.Content>
<Layout.Content style={{ height: '100%' }}>
<TagAnnotationWorkspace />
</Layout.Content>
)}

@ -98,7 +98,7 @@
padding: 10px;
border-radius: 5px;
background: $background-color-2;
width: 250px;
width: 270px;
> div {
margin-top: 5px;

@ -8,8 +8,9 @@
text-align: center;
padding-top: 40px;
overflow-y: auto;
height: 100%;
padding-bottom: 40px;
height: 90%;
position: fixed;
width: 100%;
> div > span {
font-size: 36px;

@ -273,7 +273,7 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
<GlobalErrorBoundary>
<Layout>
<HeaderContainer> </HeaderContainer>
<Layout.Content>
<Layout.Content style={{ height: '100%' }}>
<ShorcutsDialog />
<GlobalHotKeys keyMap={subKeyMap} handlers={handlers}>
<Switch>

@ -3,10 +3,11 @@
// SPDX-License-Identifier: MIT
.cvat-feedback-button {
position: absolute;
position: fixed;
bottom: 20px;
right: 20px;
padding: 0;
height: auto;
> i {
font-size: 40px;

@ -35,10 +35,10 @@ export default function DeployedModelsListComponent(props: Props): JSX.Element {
<Col span={3}>
<Text strong>Type</Text>
</Col>
<Col span={8}>
<Col span={10}>
<Text strong>Description</Text>
</Col>
<Col span={4}>
<Col span={5}>
<Text strong>Labels</Text>
</Col>
</Row>

@ -6,8 +6,10 @@
.cvat-models-page {
padding-top: 30px;
height: 100%;
height: 90%;
overflow: auto;
position: fixed;
width: 100%;
> div:nth-child(1) {
margin-bottom: 10px;

@ -9,7 +9,7 @@ import Text from 'antd/lib/typography/Text';
export default function TopBarComponent(): JSX.Element {
return (
<Row type='flex' justify='center' align='middle'>
<Col md={11} lg={9} xl={8} xxl={7}>
<Col md={22} lg={20} xl={16} xxl={14}>
<Text className='cvat-title'>Models</Text>
</Col>
</Row>

@ -6,7 +6,9 @@
.cvat-task-details-wrapper {
overflow-y: auto;
height: 100%;
height: 90%;
width: 100%;
position: fixed;
.cvat-task-details {
width: 100%;

@ -6,7 +6,10 @@
.cvat-tasks-page {
padding-top: 15px;
padding-bottom: 40px;
height: 100%;
position: fixed;
width: 100%;
> div:nth-child(1) {
padding-bottom: 10px;

Loading…
Cancel
Save