Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display files list only if there is at least one item #2745

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files/src/components/AllFilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default {
favoritesHeaderText: this.$gettext('Favorites')
}
},
mounted () {
beforeMount () {
this.$_ocFilesFolder_getFolder()
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default {
}
}
},
mounted () {
beforeMount () {
if (this.$route.name === 'files-shared-with-me') {
this.$_ocSharedWithMe_getFiles()
} else {
Expand Down
101 changes: 51 additions & 50 deletions apps/files/src/components/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,60 +23,61 @@
Actions
</div>
</oc-grid>
<RecycleScroller
id="files-list-container"
class="uk-flex-1"
:items="fileData"
:item-size="70"
v-slot="{ item, index, active }"
v-if="!loading"
:key="fileData.length"
>
<div
:data-is-visible="active"
@click="selectRow(item, $event); hideRowActionsDropdown()"
<div id="files-list-container" class="uk-flex-1" v-if="!loading">
<RecycleScroller
class="uk-height-1-1"
:items="fileData"
:item-size="70"
v-slot="{ item, index, active }"
v-if="fileData.length"
:key="fileData.length"
>
<oc-grid gutter="small" flex class="uk-padding-small oc-border-top" :class="_rowClasses(item)" :id="'file-row-' + item.id">
<div>
<oc-checkbox
class="uk-margin-small-left"
@click.stop @change.native="toggleFileSelect(item)"
:value="selectedFiles.indexOf(item) >= 0"
:label="labelSelectSingleItem(item)"
:hideLabel="true"
/>
</div>
<slot name="rowColumns" :item="item" :index="item.id" />
<div :class="{ 'uk-visible@s' : compactMode, 'uk-width-small@s uk-width-medium@m': !compactMode }" class="uk-width-auto uk-text-right">
<div
class="uk-button-group"
:class="{
'uk-visible@m' : !compactMode,
'uk-visible@xl' : compactMode
}"
>
<div
:data-is-visible="active"
@click="selectRow(item, $event); hideRowActionsDropdown()"
>
<oc-grid gutter="small" flex class="uk-padding-small oc-border-top" :class="_rowClasses(item)" :id="'file-row-' + item.id">
<div>
<oc-checkbox
class="uk-margin-small-left"
@click.stop @change.native="toggleFileSelect(item)"
:value="selectedFiles.indexOf(item) >= 0"
:label="labelSelectSingleItem(item)"
:hideLabel="true"
/>
</div>
<slot name="rowColumns" :item="item" :index="item.id" />
<div :class="{ 'uk-visible@s' : compactMode, 'uk-width-small@s uk-width-medium@m': !compactMode }" class="uk-width-auto uk-text-right">
<div
class="uk-button-group"
:class="{
'uk-visible@m' : !compactMode,
'uk-visible@xl' : compactMode
}"
>
<oc-button
v-for="action in actions"
:key="action.ariaLabel"
@click.stop="action.handler(item, action.handlerData)"
:disabled="!$_isActionEnabled(item, action) || $_actionInProgress(item)"
:icon="action.icon"
:ariaLabel="action.ariaLabel"
:uk-tooltip="$_disabledActionTooltip(item)"
/>
</div>
<oc-button
v-for="action in actions"
:key="action.ariaLabel"
@click.stop="action.handler(item, action.handlerData)"
:disabled="!$_isActionEnabled(item, action) || $_actionInProgress(item)"
:icon="action.icon"
:ariaLabel="action.ariaLabel"
:uk-tooltip="$_disabledActionTooltip(item)"
:id="actionsDropdownButtonId(item.id, active)"
icon="more_vert"
:class="{ 'uk-hidden@m' : !compactMode, 'uk-visible@s uk-hidden@xl' : compactMode }"
:disabled="$_actionInProgress(item)"
:aria-label="'show-file-actions'"
@click.stop="toggleRowActionsDropdown(item)"
/>
</div>
<oc-button
:id="actionsDropdownButtonId(item.id, active)"
icon="more_vert"
:class="{ 'uk-hidden@m' : !compactMode, 'uk-visible@s uk-hidden@xl' : compactMode }"
:disabled="$_actionInProgress(item)"
:aria-label="'show-file-actions'"
@click.stop="toggleRowActionsDropdown(item)"
/>
</div>
</oc-grid>
</div>
</RecycleScroller>
</oc-grid>
</div>
</RecycleScroller>
</div>
<oc-grid gutter="large" class="uk-width-1-1 uk-padding-small" v-if="!loading">
<slot name="footer" />
</oc-grid>
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/components/Trashbin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default {
Mixins
],

mounted () {
beforeMount () {
this.$_ocTrashbin_getFiles()
},

Expand Down