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", "name": "cvat-data",
"version": "1.0.0", "version": "1.0.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

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

@ -295,7 +295,26 @@ class FrameProvider {
worker.terminate(); 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; this._frames[event.data.index] = event.data.data;
if (this._decodingBlocks[`${start}:${end}`].resolveCallback) { if (this._decodingBlocks[`${start}:${end}`].resolveCallback) {

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

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

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

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

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

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

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

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

@ -9,7 +9,7 @@ import Text from 'antd/lib/typography/Text';
export default function TopBarComponent(): JSX.Element { export default function TopBarComponent(): JSX.Element {
return ( return (
<Row type='flex' justify='center' align='middle'> <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> <Text className='cvat-title'>Models</Text>
</Col> </Col>
</Row> </Row>

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

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

Loading…
Cancel
Save