Skip to content

Commit 23043d1

Browse files
committed
Fix previous tizen api
1 parent fc9e1f2 commit 23043d1

File tree

7 files changed

+24
-6
lines changed

7 files changed

+24
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Docs View
2+
Tizen web app for opening `pdf`, `txt` and `md`

src/components/InViewSettings.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
.close-button img {
5151
height: 38px;
5252
position: relative;
53-
top: 50%;
54-
transform: translateY(-50%);
53+
top: 34px;
5554
}
5655
5756
.wrapper {

src/components/List.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@
140140
141141
.subtitle {
142142
font-size: 1.8em;
143+
/* TODO: сделать плавающий текст */
144+
max-height: 72px;
145+
overflow: hidden;
146+
word-break: break-all;
143147
}
144148
145149
.title {

src/pages/Help.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<style>
4848
.container {
4949
text-align: center;
50-
padding: 30px 50px;
50+
padding: 70px 2.0625rem;
5151
box-sizing: border-box;
5252
font-size: 1.6em;
5353
height: 360px;

src/pages/MainScreen.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import List from "../components/List.svelte"
44
import {configStore, historyStore} from "../store"
55
import {isDev, pages} from "../constants"
6-
import {getViewPageId} from "../utils"
6+
import {getViewPageId, pathExists} from "../utils"
77
88
let pagesList = [
99
{title: "Open", subtitle: "Open a load file", pageId: pages.filesList},
@@ -12,7 +12,7 @@
1212
]
1313
if ($configStore.lastFile) {
1414
let path = $configStore.lastFile
15-
if (isDev || tizen.filesystem.pathExists(path)) {
15+
if (isDev || pathExists(path)) {
1616
let filename = path.split("/")
1717
filename = filename[filename.length - 1]
1818
pagesList = [

src/pages/TxtView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
height: inherit;
126126
overflow: scroll;
127127
scroll-behavior: smooth;
128-
padding: 60px 2.0625rem;
128+
padding: 70px 2.0625rem;
129129
box-sizing: border-box;
130130
background: white;
131131
color: black;

src/utils.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global tizen */
12
import {pages} from "./constants"
23

34
export function scrollTo(node, x, y) {
@@ -35,3 +36,15 @@ export function getViewPageId(path) {
3536
export function getExtension(path) {
3637
return path.split(".").pop().toLowerCase()
3738
}
39+
40+
export async function pathExists(path) {
41+
if (tizen.filesystem.pathExists) return tizen.filesystem.pathExists(path)
42+
return new Promise((resolve) =>
43+
tizen.filesystem.resolve(
44+
path,
45+
() => resolve(true),
46+
() => resolve(false),
47+
"r"
48+
)
49+
)
50+
}

0 commit comments

Comments
 (0)