Skip to content

Commit e579d48

Browse files
committed
mobile fix.
1 parent 201002d commit e579d48

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

css/designer.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
z-index: 20;
127127
padding: 8px 0 8px 8px;
128128
border-radius: 10px;
129+
white-space: nowrap;
129130
}
130131
.sqd-control-bar-button {
131132
display: inline-block;

examples/assets/code-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Editors {
125125
});
126126
root.appendChild(nameItem);
127127

128-
const numberPropNames = ['value'];
128+
const numberPropNames = ['value', 'from', 'to'];
129129
for (let propName of Object.keys(step.properties)) {
130130
const isNumberProp = numberPropNames.includes(propName);
131131
const item = document.createElement('p');

examples/code-generator.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<style>
99
body {font: 14px/1.3em 'Open Sans', Arial, Verdana, Serif;}
1010
html, body {width: 100vw; height: 100vh; margin: 0; padding: 0; overflow: hidden;}
11-
#designer {position: absolute; top: 0; left: 0; bottom: 0; right: 30%;}
12-
#output {position: absolute; top: 0; right: 0; bottom: 0; left: 70%; padding: 10px; box-sizing: border-box; color: #FFF; background: #151515;}
11+
#designer {position: absolute; top: 0; left: 0; bottom: 0; right: 42%;}
12+
#output {position: absolute; top: 0; right: 0; bottom: 0; left: 58%; padding: 10px; box-sizing: border-box; color: #FFF; background: #151515;}
1313
#output #code {color: silver;}
1414
#output #result {color: yellow;}
1515

src/toolbox/scrollbox-view.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export class ScrollBoxView {
8484
}
8585

8686
private onTouchStart(e: TouchEvent) {
87+
e.preventDefault();
8788
this.startScroll(readTouchPosition(e));
8889
}
8990

src/toolbox/toolbox-item.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class ToolboxItem {
2121
private constructor(private readonly step: StepDefinition, private readonly context: DesignerContext) {}
2222

2323
private onTouchstart(e: TouchEvent) {
24+
e.preventDefault();
2425
if (e.touches.length === 1) {
2526
e.stopPropagation();
2627
this.startDrag(readTouchPosition(e));

src/workspace/workspace-view.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ export class WorkspaceView {
100100
}
101101

102102
public bindTouchStart(handler: (position: Vector) => void) {
103-
this.canvas.addEventListener('touchstart', e => handler(readTouchPosition(e)), false);
103+
this.canvas.addEventListener(
104+
'touchstart',
105+
e => {
106+
e.preventDefault();
107+
handler(readTouchPosition(e));
108+
},
109+
false
110+
);
104111
}
105112

106113
public bindContextMenu(handler: (e: MouseEvent) => void) {

0 commit comments

Comments
 (0)