Skip to content

Commit

Permalink
Revert "Fix limited links update bug"
Browse files Browse the repository at this point in the history
This reverts commit 0268bf9.
  • Loading branch information
TahaSh committed Sep 3, 2016
1 parent 0268bf9 commit be1f74d
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 23 deletions.
5 changes: 2 additions & 3 deletions dist/vue-paginate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-paginate v2.1.2
* vue-paginate v2.1.0
* (c) 2016 Taha Shashtari
* Released under the MIT License.
*/
Expand Down Expand Up @@ -205,7 +205,7 @@
}, {
key: 'initialOfLastNav',
value: function initialOfLastNav() {
var numberOfNavs = ~~(this.list.numberOfPages / this.limit);
var numberOfNavs = ~ ~(this.list.numberOfPages / this.limit);
var rest = this.list.numberOfPages - this.limit * numberOfNavs;

rest = rest <= 1 ? rest + this.limit : rest;
Expand Down Expand Up @@ -262,7 +262,6 @@
// Update the original list when the user changes the full list.
vm.$watch('full' + utils.capitalize(this.listName), function (newVal, oldVal) {
_this.originalList = newVal;
_this.setNumberOfPages(_this.originalList.length);
vm['refresh' + utils.capitalize(_this.listName) + 'Page']();
});

Expand Down
4 changes: 2 additions & 2 deletions dist/vue-paginate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/vue-paginate.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-paginate",
"version": "2.1.2",
"version": "2.1.1",
"description": "A simple vue.js plugin to paginate data",
"main": "dist/vue-paginate.js",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion src/paginate.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default {
// Update the original list when the user changes the full list.
vm.$watch('full' + utils.capitalize(this.listName), (newVal, oldVal) => {
this.originalList = newVal;
this.setNumberOfPages(this.originalList.length);
vm['refresh' + utils.capitalize(this.listName) + 'Page']();
});

Expand Down
16 changes: 0 additions & 16 deletions test/functional/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,6 @@ describe('Vue-Paginate', () => {

vm.$data.limitedLangsLinks.should.eql([1, 2, 3, 4, 5, 6, 7]);
});

it('updates the links when the list is updated', (done) => {
vm = new Vue({
template: '<div v-paginate:1="langs" limit="6">Hello</div>',
data: {
langs: ['PHP']
}
}).$mount();

vm.$data.fullLangs = ['PHP', 'JavaScript', 'HTML', 'CSS', 'Ruby', 'Python', 'Erlang'];

Vue.nextTick(() => {
vm.$data.limitedLangsLinks.should.eql([1, 2, 3, 4, 5, 6, 7]);
done();
});
});
});

describe('Dynamic perPage', () => {
Expand Down

0 comments on commit be1f74d

Please sign in to comment.