efront 3.20.15 → 3.20.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coms/kugou/player.js +9 -11
- package/coms/zimoli/lattice.js +18 -11
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/kugou/player.js
CHANGED
|
@@ -101,6 +101,7 @@ var $scope = {
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
process(currentTime, duration) {
|
|
104
|
+
render.refresh();
|
|
104
105
|
if (currentTime === duration) {
|
|
105
106
|
$scope.pause();
|
|
106
107
|
return false;
|
|
@@ -179,6 +180,7 @@ var $scope = {
|
|
|
179
180
|
}
|
|
180
181
|
},
|
|
181
182
|
play(hash = musicList.active_hash) {
|
|
183
|
+
render.refresh();
|
|
182
184
|
var isPlayback = typeof hash === "number";
|
|
183
185
|
if (isPlayback) {
|
|
184
186
|
if (hash < 0) {
|
|
@@ -232,7 +234,6 @@ var $scope = {
|
|
|
232
234
|
return alert("暂不支持在您的浏览器中播放!");
|
|
233
235
|
}
|
|
234
236
|
musicList.active_hash = hash;
|
|
235
|
-
render.refresh();
|
|
236
237
|
$scope.playing = true;
|
|
237
238
|
playState.width = 0;
|
|
238
239
|
getMusicInfo(hash).loading_promise.then((response) => {
|
|
@@ -295,16 +296,13 @@ var createControls = function () {
|
|
|
295
296
|
var player = document.createElement("music-player");
|
|
296
297
|
player.setAttribute("ng-class", "{play:playing===true,pause:playing===false,page:page,effect:effect}");
|
|
297
298
|
player.innerHTML = Player;
|
|
298
|
-
var [
|
|
299
|
-
bindtouch(player, function (
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
$scope.process(x / player.offsetWidth * _audio.duration, _audio.duration);
|
|
306
|
-
}
|
|
307
|
-
return { x: progress.offsetWidth };
|
|
299
|
+
var [, progress] = player.children;
|
|
300
|
+
bindtouch(player, function (_, event) {
|
|
301
|
+
touching = true;
|
|
302
|
+
var x = event.clientX - getScreenPosition(player).left;
|
|
303
|
+
let _audio = $scope.audio
|
|
304
|
+
css(progress, { width: x });
|
|
305
|
+
$scope.process(x / player.offsetWidth * _audio.duration, _audio.duration);
|
|
308
306
|
}, "x");
|
|
309
307
|
bindtouch(player, function (value) {
|
|
310
308
|
var top = getScreenPosition(player).top;
|
package/coms/zimoli/lattice.js
CHANGED
|
@@ -7,6 +7,7 @@ function lattice(element, minWidth, maxWidth = minWidth << 1, layers) {
|
|
|
7
7
|
if (!_layers.length) return;
|
|
8
8
|
var clientWidth = parseFloat(freePixel(_box.clientWidth));
|
|
9
9
|
if (!clientWidth) return;
|
|
10
|
+
var savedCount = boxCount;
|
|
10
11
|
boxCount = clientWidth / minWidth | 0;
|
|
11
12
|
if (boxCount >= _layers.length) {
|
|
12
13
|
boxCount = _layers.length;
|
|
@@ -21,6 +22,12 @@ function lattice(element, minWidth, maxWidth = minWidth << 1, layers) {
|
|
|
21
22
|
else removeClass(_box, inadequate_class);
|
|
22
23
|
_box.paddingMax = boxCount;
|
|
23
24
|
_box.group = boxCount;
|
|
25
|
+
if (savedCount === boxCount) return;
|
|
26
|
+
_box.clean();
|
|
27
|
+
[].forEach.call(_box.children, function (c) {
|
|
28
|
+
build(c);
|
|
29
|
+
});
|
|
30
|
+
return true;
|
|
24
31
|
};
|
|
25
32
|
if (layers) {
|
|
26
33
|
var _box = list(element, function (index) {
|
|
@@ -53,19 +60,19 @@ function lattice(element, minWidth, maxWidth = minWidth << 1, layers) {
|
|
|
53
60
|
if (element.with instanceof Array) element.with.forEach(build);
|
|
54
61
|
else if (isElement(element.with)) build(element.with);
|
|
55
62
|
};
|
|
63
|
+
var go = _box.go;
|
|
64
|
+
_box.go = function () {
|
|
65
|
+
resize();
|
|
66
|
+
go.apply(this, arguments);
|
|
67
|
+
};
|
|
56
68
|
_box.resize = lazy(function () {
|
|
57
|
-
var savedCount = boxCount;
|
|
58
|
-
console.log(savedCount)
|
|
59
69
|
var index = _box.index();
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
build(c);
|
|
67
|
-
});
|
|
68
|
-
_box.go(index);
|
|
70
|
+
var savedCount = boxCount;
|
|
71
|
+
if (resize()) {
|
|
72
|
+
var realIndex = index * (savedCount || 1);
|
|
73
|
+
index = realIndex / boxCount || 0;
|
|
74
|
+
go.call(_box, index);
|
|
75
|
+
}
|
|
69
76
|
});
|
|
70
77
|
resizingList.set(_box);
|
|
71
78
|
on('resize')(_box, _box.resize);
|