A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/98e17ca85588b858f5d74e217c48fa82f11f487f below:

properly calculate number of links with `hide-elli… · bootstrap-vue/bootstrap-vue@98e17ca · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+28

-7

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+28

-7

lines changed Original file line number Diff line number Diff line change

@@ -374,6 +374,25 @@ describe('pagination', () => {

374 374

wrapper.destroy()

375 375

})

376 376 377 +

it('has correct number of links when `hide-ellipsis` is enabled', async () => {

378 +

const wrapper = mount(BPagination, {

379 +

propsData: {

380 +

hideEllipsis: true,

381 +

totalRows: 100,

382 +

perPage: 10,

383 +

value: 1

384 +

}

385 +

})

386 +

expect(wrapper.element.tagName).toBe('UL')

387 +

expect(wrapper.findAll('li').length).toBe(9)

388 + 389 +

await wrapper.setProps({ value: 5 })

390 +

await waitNT(wrapper.vm)

391 +

expect(wrapper.findAll('li').length).toBe(9)

392 + 393 +

wrapper.destroy()

394 +

})

395 + 377 396

it('has attribute aria-controls on page links when prop aria-controls is set', async () => {

378 397

const wrapper = mount(BPagination, {

379 398

propsData: {

Original file line number Diff line number Diff line change

@@ -223,12 +223,14 @@ export default {

223 223

},

224 224

paginationParams() {

225 225

// Determine if we should show the the ellipsis

226 -

const limit = this.localLimit

227 -

const numberOfPages = this.localNumberOfPages

228 -

const currentPage = this.computedCurrentPage

229 -

const hideEllipsis = this.hideEllipsis

230 -

const firstNumber = this.firstNumber

231 -

const lastNumber = this.lastNumber

226 +

const {

227 +

localLimit: limit,

228 +

localNumberOfPages: numberOfPages,

229 +

computedCurrentPage: currentPage,

230 +

hideEllipsis,

231 +

firstNumber,

232 +

lastNumber

233 +

} = this

232 234

let showFirstDots = false

233 235

let showLastDots = false

234 236

let numberOfLinks = limit

@@ -252,7 +254,7 @@ export default {

252 254

} else {

253 255

// We are somewhere in the middle of the page list

254 256

if (limit > ELLIPSIS_THRESHOLD) {

255 -

numberOfLinks = limit - 2

257 +

numberOfLinks = limit - (hideEllipsis ? 0 : 2)

256 258

showFirstDots = !!(!hideEllipsis || firstNumber)

257 259

showLastDots = !!(!hideEllipsis || lastNumber)

258 260

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4