dnet45/modules/uoa-repository-dashboard-gui/trunk/src/public/js/core/gif.js @ 46812
1 |
import { isInView } from '../util/index'; |
---|---|
2 |
|
3 |
export default function (UIkit) { |
4 |
|
5 |
UIkit.component('gif', { |
6 |
|
7 |
update: { |
8 |
|
9 |
read() { |
10 |
|
11 |
var inview = isInView(this.$el); |
12 |
|
13 |
if (!this.isInView && inview) { |
14 |
this.$el[0].src = this.$el[0].src; |
15 |
}
|
16 |
|
17 |
this.isInView = inview; |
18 |
},
|
19 |
|
20 |
events: ['scroll', 'load', 'resize'] |
21 |
}
|
22 |
|
23 |
});
|
24 |
|
25 |
}
|