Use NcActions for buttons

pull/37/head
Varun Patil 2022-09-08 16:40:55 -07:00
parent 3ead2d4e2a
commit 13da56a2f6
1 changed files with 28 additions and 11 deletions

View File

@ -59,23 +59,39 @@
<!-- Top bar for selections etc --> <!-- Top bar for selections etc -->
<div v-if="selection.size > 0" class="top-bar"> <div v-if="selection.size > 0" class="top-bar">
<button class="btn icon icon-close" @click="clearSelection"></button> <NcActions>
<NcActionButton
:aria-label="t('memories', 'Cancel selection')"
@click="clearSelection"
class="icon-close">
{{ t('memories', 'Cancel') }}
</NcActionButton>
</NcActions>
<div class="text"> <div class="text">
{{ selection.size }} item(s) selected {{ selection.size }} item(s) selected
</div> </div>
<button class="btn icon icon-delete" @click="deleteSelection"></button>
<NcActions>
<NcActionButton
:aria-label="t('memories', 'Delete selection')"
@click="deleteSelection"
class="icon-delete">
{{ t('memories', 'Delete') }}
</NcActionButton>
</NcActions>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import * as dav from "../services/DavRequests"; import * as dav from "../services/DavRequests";
import axios from '@nextcloud/axios' import axios from '@nextcloud/axios'
import Folder from "./Folder"; import Folder from "./Folder";
import Photo from "./Photo"; import Photo from "./Photo";
import constants from "../mixins/constants"; import constants from "../mixins/constants";
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router'
import { NcActions, NcActionButton, NcButton } from '@nextcloud/vue'
const MAX_PHOTO_WIDTH = 175; const MAX_PHOTO_WIDTH = 175;
const MIN_COLS = 3; const MIN_COLS = 3;
@ -84,6 +100,9 @@ export default {
components: { components: {
Folder, Folder,
Photo, Photo,
NcActions,
NcActionButton,
NcButton
}, },
data() { data() {
return { return {
@ -731,7 +750,6 @@ export default {
this.loading = false; this.loading = false;
await this.deleteFromViewWithAnimation(delIds, updatedDays); await this.deleteFromViewWithAnimation(delIds, updatedDays);
this.clearSelection();
}, },
/** /**
@ -802,6 +820,9 @@ export default {
} }
} }
// clear selection at this point
this.clearSelection();
// wait for 200ms // wait for 200ms
await new Promise(resolve => setTimeout(resolve, 200)); await new Promise(resolve => setTimeout(resolve, 200));
@ -928,14 +949,9 @@ export default {
} }
.top-bar .text { .top-bar .text {
flex-grow: 1; flex-grow: 1;
line-height: 36px; line-height: 40px;
padding-left: 8px; padding-left: 8px;
} }
.top-bar .btn {
display: inline-block;
margin-right: 3px;
cursor: pointer;
}
/* Mobile layout */ /* Mobile layout */
@media (max-width: 768px) { @media (max-width: 768px) {
@ -952,7 +968,8 @@ export default {
display: none; display: none;
} }
.head-row.first { .head-row.first {
padding-left: 34px; padding-left: 38px;
padding-top: 12px;
} }
} }
</style> </style>