# KYOIKU 2023-1 Checklist # 1. Correct Meta (căn trung tâm) ```code=html <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover"> ``` # 2. Kiểm tra xem có file js nào bị tải 2 lần hay không (biểu hiện là sự kiện ăn 2 lần) # 3. Bỏ defer trong load các file js, cho các file index.js, main.js ở cuối cùng # 4. Sửa lỗi file index.html nếu có bằng tool prettier # 5. Đặt tên title đúng (trong thẻ head/title) # 6. Đặt css cho html (fix bug js touch preventDefault + scroll ipad khi mở popup) ```code=css html { touch-action: none; -ms-touch-action: none; } ``` # 7. Close popup callback ```code=js function btn2Click(evt, note) { console.log("btn2Click"); if (note == "close") { btn2_active = true; } if (btn2_active) { btn2_active = false; btn2.gotoAndStop(0); if (!note) openPopup(false); } else { btn2_active = true; btn2.gotoAndStop(1); openPopup(true); } } ``` ![](https://i.imgur.com/GxY1dET.png) - Bỏ thêm **rect-bg** vào trong ignore elements ```code=js initDragEvent(_.flattenDeep(["canvas", "rect-bg"])); ``` # 8. Bug fullscreen - Trong index.html, cho stage_0 display none ![](https://i.imgur.com/Jd0Iya7.png) ```code=js const fnReady = async () => { initPallet(); await delay(50); initMain(); await delay(50); initIndex(); await delay(50); $("#stage_0").css("display", "block"); }; $(document).ready(function () { fnReady(); }); ``` # 9. PopupV2 - Sửa lại hàm openPopup ```code=js const openPopup = (newValue, isCallback) => { console.log(`openPopup ${newValue}`); g_state.show_popup = newValue; getControl("btn-show-popup").render(); if (!newValue && g_state.closeCB) g_state.closeCB(); }; ``` - Update ```code=js // update from window.stage._handlePointerDown(-1, e, e.clientX, e.clientY); window.stage._handlePointerUp(-1); // to window.stage._handlePointerDown(-1, e, e.clientX, e.clientY); window.stage._handlePointerUp(-1, e, true); ```