(paneKey, sourceId)
| 2049 | let __frTreeSourceId = null; |
| 2050 | |
| 2051 | function syncActiveSourceToPane(paneKey, sourceId) { |
| 2052 | const targetId = sourceId || getPaneSourceId(paneKey); |
| 2053 | const currentId = getGlobalActiveSourceId(); |
| 2054 | if (!targetId || targetId === currentId) return Promise.resolve(false); |
| 2055 | |
| 2056 | if (typeof window.__frApplyActiveSource === 'function') { |
| 2057 | return window.__frApplyActiveSource(targetId, { skipEvent: true, origin: 'pane' }); |
| 2058 | } |
| 2059 | |
| 2060 | const sel = document.getElementById('sourceSelector'); |
| 2061 | if (sel) sel.value = targetId; |
| 2062 | try { localStorage.setItem('fr_active_source', targetId); } catch (e) { /* ignore */ } |
| 2063 | return Promise.resolve(true); |
| 2064 | } |
| 2065 | |
| 2066 | function refreshTreeForSource(folder, sourceId) { |
| 2067 | const nextId = sourceId || getGlobalActiveSourceId(); |
no test coverage detected