| 7142 | } |
| 7143 | |
| 7144 | preloadImageHandler() { |
| 7145 | if (this.preloadingImage || !this.unCheckedImgs.length) return; |
| 7146 | this.preloadingImage = true; |
| 7147 | let src = this.unCheckedImgs.shift(), i = 0, promiseList = []; |
| 7148 | |
| 7149 | while(src) { |
| 7150 | promiseList.push(this.preloadOneImg(src)); |
| 7151 | if (++i > 5) { |
| 7152 | break; |
| 7153 | } else { |
| 7154 | src = this.unCheckedImgs.shift(); |
| 7155 | } |
| 7156 | } |
| 7157 | Promise.all(promiseList).then(e => { |
| 7158 | this.preloadingImage = false; |
| 7159 | }); |
| 7160 | } |
| 7161 | |
| 7162 | preload() { |
| 7163 | if (!rulesData.preload) return; |