Skip to content

Commit

Permalink
preventDefault & resize
Browse files Browse the repository at this point in the history
  • Loading branch information
sentivate committed Jan 19, 2022
1 parent 3f6797d commit 3f3472c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
10 changes: 8 additions & 2 deletions uwBridge/system/compile/build/socket/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
let screenSize;
if (isAgent.mobile) {
screenSize = 'mobileScreen';
} else if (width < 690) {
screenSize = 'tinyScreen';
} else if (width < 1024) {
screenSize = 'smallScreen';
} else if (width < 1920) {
Expand Down Expand Up @@ -672,8 +674,12 @@
});
}
},
'*.preventDefault'() {
return false;
'*.preventDefault'(context) {
const {
original
} = context;
original.preventDefault();
original.stopPropagation();
}
});
app.importComponent = async (componentName, importURL, type = 'dynamic') => {
Expand Down
10 changes: 8 additions & 2 deletions uwBridge/system/compile/build/socket/coreBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
let screenSize;
if (isAgent.mobile) {
screenSize = 'mobileScreen';
} else if (width < 690) {
screenSize = 'tinyScreen';
} else if (width < 1024) {
screenSize = 'smallScreen';
} else if (width < 1920) {
Expand Down Expand Up @@ -670,8 +672,12 @@
});
}
},
'*.preventDefault'() {
return false;
'*.preventDefault'(context) {
const {
original
} = context;
original.preventDefault();
original.stopPropagation();
}
});
app.importComponent = async (componentName, importURL, type = 'dynamic') => {
Expand Down
8 changes: 6 additions & 2 deletions uwBridge/system/compile/source/socket/component/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ view.on({
});
}
},
'*.preventDefault'() {
return false;
'*.preventDefault'(context) {
const {
original
} = context;
original.preventDefault();
original.stopPropagation();
},
});
app.importComponent = async (componentName, importURL, type = 'dynamic') => {
Expand Down
2 changes: 2 additions & 0 deletions uwBridge/system/compile/source/socket/events/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const updateResize = debounce(async () => {
let screenSize;
if (isAgent.mobile) {
screenSize = 'mobileScreen';
} else if (width < 690) {
screenSize = 'tinyScreen';
} else if (width < 1024) {
screenSize = 'smallScreen';
} else if (width < 1920) {
Expand Down

0 comments on commit 3f3472c

Please sign in to comment.