Skip to content

Commit

Permalink
Add glowing effect when adding a row.
Browse files Browse the repository at this point in the history
  • Loading branch information
lenadax committed Nov 5, 2024
1 parent c86515c commit 9465805
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
13 changes: 11 additions & 2 deletions js/src/bootstrap5/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class ArrayWidget extends ArrayBase {

up_handle(evt) {
super.up_handle(evt);
let row = this.get_row(evt.currentTarget);
const row = this.get_row(evt.currentTarget);
row.addClass('row-moved');
setTimeout(function() {
row.removeClass('row-moved');
Expand All @@ -66,10 +66,19 @@ export class ArrayWidget extends ArrayBase {

down_handle(evt) {
super.down_handle(evt);
let row = this.get_row(evt.currentTarget);
const row = this.get_row(evt.currentTarget);
row.addClass('row-moved');
setTimeout(function() {
row.removeClass('row-moved');
}, 1000);
}

create_row() {
const row = super.create_row();
row.addClass('row-moved');
setTimeout(function() {
row.removeClass('row-moved');
}, 1000);
return row;
}
}
12 changes: 10 additions & 2 deletions src/yafowil/widget/array/resources/bootstrap5/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,20 +234,28 @@ var yafowil_array = (function (exports, $) {
}
up_handle(evt) {
super.up_handle(evt);
let row = this.get_row(evt.currentTarget);
const row = this.get_row(evt.currentTarget);
row.addClass('row-moved');
setTimeout(function() {
row.removeClass('row-moved');
}, 1000);
}
down_handle(evt) {
super.down_handle(evt);
let row = this.get_row(evt.currentTarget);
const row = this.get_row(evt.currentTarget);
row.addClass('row-moved');
setTimeout(function() {
row.removeClass('row-moved');
}, 1000);
}
create_row() {
const row = super.create_row();
row.addClass('row-moved');
setTimeout(function() {
row.removeClass('row-moved');
}, 1000);
return row;
}
}

$(function() {
Expand Down

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

0 comments on commit 9465805

Please sign in to comment.