* Initialize files app * @param {HTMLElement} el
(el)
| 19 | * @param {HTMLElement} el |
| 20 | */ |
| 21 | function initApp(el) { |
| 22 | container = el; |
| 23 | container.classList.add("files"); |
| 24 | container.setAttribute("data-msg", strings["open folder"]); |
| 25 | container.style.overflowX = "auto"; |
| 26 | container.addEventListener("click", clickHandler); |
| 27 | editorManager.on( |
| 28 | ["new-file", "int-open-file-list", "remove-file"], |
| 29 | (position) => { |
| 30 | if ( |
| 31 | typeof position === "string" && |
| 32 | position !== settings.OPEN_FILE_LIST_POS_SIDEBAR |
| 33 | ) |
| 34 | return; |
| 35 | const fileList = container.get(":scope > div.file-list"); |
| 36 | if (fileList) fixHeight(fileList); |
| 37 | }, |
| 38 | ); |
| 39 | editorManager.on("add-folder", fixHeight); |
| 40 | Sidebar.on("show", onSelected); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * On selected handler for files app |