Skip to content

Commit

Permalink
update ractive keyed row swap per krausest#694
Browse files Browse the repository at this point in the history
  • Loading branch information
evs-chris committed Feb 14, 2020
1 parent 67dbd1a commit cc9a97f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frameworks/keyed/ractive/src/main.ractive.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ <h1>Ractive keyed</h1>
that.set("selected", undefined);
});
this.on('swapRows', function (event) {
if(this.get('data').length > 998) {
var a = this.get('data')[1];
this.splice('data', 1, 1, this.get('data')[998]);
this.splice('data', 998, 1, a);
const data = this.get('data');
if (data.length > 998) {
const a = data[1];
data.splice(1, 1, data[998]);
data.splice(998, 1, a);
this.set('data', data, { shuffle: true });
}
});
},
Expand Down

0 comments on commit cc9a97f

Please sign in to comment.