Skip to content

Commit

Permalink
Display files list only if there is at least one item
Browse files Browse the repository at this point in the history
Adjusted list container selector

Use table selector instead of tableContainer

Added list container

Use beforeMount to load folder
  • Loading branch information
LukasHirt committed Jan 8, 2020
1 parent 3228d08 commit 6753750
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 53 deletions.
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

0 comments on commit 6753750

Please sign in to comment.