Skip to content

Commit

Permalink
fix(web-renderer): fix codeReview issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gguoyu committed Sep 22, 2023
1 parent 9237ee0 commit 696f203
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ListView extends HippyWebView<HTMLDivElement> {
}

public defaultStyle() {
return { display: 'flex', flex: 1, flexDirection: 'column', flexShrink: 0, boxSizing: 'border-box', overflow: 'scroll' };
return { display: 'flex', flexDirection: 'column', flexShrink: 0, boxSizing: 'border-box', overflow: 'scroll' };
}

public get overScrollEnabled() {
Expand Down
20 changes: 10 additions & 10 deletions driver/js/packages/hippy-web-renderer/src/env/dynamic-load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
* limitations under the License.
*/

export const dynamicLoad = (path: string, cb) => {
const s = document.createElement('script');
s.async = true;
s.setAttribute('src', path);
if (cb) {
s.onload = () => {
cb();
export const dynamicLoad = (path: string, callback: Function): void => {
const script = document.createElement('script');
script.async = true;
script.setAttribute('src', path);
if (typeof callback === 'function') {
script.onload = () => {
callback();
};
s.onerror = () => {
cb('load script error');
script.onerror = () => {
callback(`load script "${path}" error`);
};
}
document.head.appendChild(s);
document.head.appendChild(script);
};

0 comments on commit 696f203

Please sign in to comment.