mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 05:03:57 +00:00
set tab preview mode off in markTabUnsaved
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
export let tabid;
|
export let tabid;
|
||||||
export let tabVisible;
|
export let tabVisible;
|
||||||
export let tabFocused;
|
export let tabFocused;
|
||||||
|
export let tabPreviewMode;
|
||||||
export let tabComponent;
|
export let tabComponent;
|
||||||
|
|
||||||
setContext('tabid', tabid);
|
setContext('tabid', tabid);
|
||||||
@@ -19,7 +20,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class:tabVisible>
|
<div class:tabVisible>
|
||||||
<svelte:component this={tabComponent} {...$$restProps} {tabid} {tabVisible} {tabFocused} />
|
<svelte:component this={tabComponent} {...$$restProps} {tabid} {tabVisible} {tabFocused} {tabPreviewMode} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -53,5 +53,6 @@
|
|||||||
unsaved={openedTabsByTabId[tabid]?.unsaved}
|
unsaved={openedTabsByTabId[tabid]?.unsaved}
|
||||||
tabVisible={tabid == shownTab?.tabid}
|
tabVisible={tabid == shownTab?.tabid}
|
||||||
tabFocused={tabid == shownTab?.tabid && shownTab?.focused}
|
tabFocused={tabid == shownTab?.tabid && shownTab?.focused}
|
||||||
|
tabPreviewMode={tabid == shownTab?.tabid && shownTab?.tabPreviewMode}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ export function changeTab(tabid, changeFunc) {
|
|||||||
export function markTabUnsaved(tabid) {
|
export function markTabUnsaved(tabid) {
|
||||||
const tab = getOpenedTabs().find(x => x.tabid == tabid);
|
const tab = getOpenedTabs().find(x => x.tabid == tabid);
|
||||||
if (tab.unsaved) return;
|
if (tab.unsaved) return;
|
||||||
openedTabs.update(files => files.map(tab => (tab.tabid == tabid ? { ...tab, unsaved: true } : tab)));
|
openedTabs.update(files =>
|
||||||
|
files.map(tab => (tab.tabid == tabid ? { ...tab, unsaved: true, tabPreviewMode: false } : tab))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function markTabSaved(tabid) {
|
export function markTabSaved(tabid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user