efront 3.20.10 → 3.20.14
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/basic/cross_.js +10 -6
- package/coms/kugou/player.js +1 -1
- package/coms/kugou/player.less +2 -2
- package/coms/layer/glance.js +1 -1
- package/coms/zimoli/AudioContext_test.js +1 -1
- package/coms/zimoli/HexEditor.less +5 -2
- package/coms/zimoli/audio.js +64 -82
- package/coms/zimoli/audio_test.html +1 -1
- package/coms/zimoli/audio_test.js +1 -3
- package/coms/zimoli/bind.js +2 -3
- package/coms/zimoli/lattice.js +3 -12
- package/coms/zimoli/lattice_test.js +1 -1
- package/coms/zimoli/model.less +3 -0
- package/coms/zimoli/onmounted.js +1 -1
- package/coms/zimoli/picture.js +1 -1
- package/coms/zimoli/popup.js +1 -2
- package/coms/zimoli/render.js +1 -1
- package/coms/zimoli/resize.js +25 -28
- package/coms/zimoli/script.js +1 -1
- package/coms/zimoli/scrollbar.js +1 -1
- package/coms/zimoli/selectList_test.html +1 -1
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/basic/cross_.js
CHANGED
|
@@ -29,7 +29,12 @@ function isChildPath(relative, path) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var getCrossUrl = function (domain, headers, encrypt) {
|
|
32
|
-
if (notCross(domain,
|
|
32
|
+
if (notCross(domain, encrypt)) return domain;
|
|
33
|
+
var basehost = parseURL(base).host || parseURL(location_href).host;
|
|
34
|
+
if (parseURL(domain).host === basehost) {
|
|
35
|
+
if (!encrypt) return domain;
|
|
36
|
+
domain = domain.replace(domainReg, "/$3$4");
|
|
37
|
+
}
|
|
33
38
|
var originDomain = getDomainPath(domain);
|
|
34
39
|
var _cookies = getCookies(originDomain);
|
|
35
40
|
var _headers = {};
|
|
@@ -102,7 +107,7 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
102
107
|
};
|
|
103
108
|
if (/^jsonp/i.test(method)) {
|
|
104
109
|
var cb = method.split('\-')[1] || 'callback';
|
|
105
|
-
|
|
110
|
+
Promise.resolve().then(function () {
|
|
106
111
|
if (!isEmpty(jsondata) && isEmpty(datas)) {
|
|
107
112
|
datas = serialize(jsondata);
|
|
108
113
|
}
|
|
@@ -112,6 +117,7 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
112
117
|
});
|
|
113
118
|
var xhr = jsonp(url, {
|
|
114
119
|
[cb](a) {
|
|
120
|
+
removeFromList(requests, this);
|
|
115
121
|
onload({ status: 200, response: JSON.stringify(a), toString: toResponse });
|
|
116
122
|
}
|
|
117
123
|
});
|
|
@@ -280,9 +286,7 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
280
286
|
else send.call(xhr);
|
|
281
287
|
digest();
|
|
282
288
|
};
|
|
283
|
-
|
|
284
|
-
setTimeout(fire, 0);
|
|
285
|
-
|
|
289
|
+
Promise.resolve().then(fire);
|
|
286
290
|
}
|
|
287
291
|
var setRequestHeader = xhr.setRequestHeader;
|
|
288
292
|
var realHeaders = Object.create(null);
|
|
@@ -335,7 +339,7 @@ function addDirect(a) {
|
|
|
335
339
|
function notCross(domain, encrypt) {
|
|
336
340
|
if (!location_href || !base || !/^https?\:\/\/|^s?\/\//.test(domain)) return true;
|
|
337
341
|
if (location_href === domain.slice(0, location_href.length) ||
|
|
338
|
-
domain.replace(domainReg, '$2') === base.replace(domainReg, '$2')) return !encrypt;
|
|
342
|
+
domain.replace(domainReg, '$2') === base.replace(domainReg, '$2') || /^\/[^\/]/.test(domain)) return !encrypt;
|
|
339
343
|
for (var cx = 0, dx = cors_hosts.length; cx < dx; cx++) {
|
|
340
344
|
var host = cors_hosts[cx];
|
|
341
345
|
if (host instanceof RegExp) {
|
package/coms/kugou/player.js
CHANGED
|
@@ -118,7 +118,6 @@ var $scope = {
|
|
|
118
118
|
$scope.currentTheta = ((currentTime * 6 + 90) % 180 - 90) / 180 * Math.PI;
|
|
119
119
|
playState.width = (currentTime * 100 / duration).toFixed(2) + `%`;
|
|
120
120
|
$scope.currentProcess = `width:` + playState.width;
|
|
121
|
-
render.refresh();
|
|
122
121
|
},
|
|
123
122
|
effectPage(effect = !$scope.effect) {
|
|
124
123
|
$scope.effect = effect;
|
|
@@ -302,6 +301,7 @@ var createControls = function () {
|
|
|
302
301
|
touching = true;
|
|
303
302
|
var { x } = value;
|
|
304
303
|
let _audio = $scope.audio;
|
|
304
|
+
css(progress, { width: x });
|
|
305
305
|
$scope.process(x / player.offsetWidth * _audio.duration, _audio.duration);
|
|
306
306
|
}
|
|
307
307
|
return { x: progress.offsetWidth };
|
package/coms/kugou/player.less
CHANGED
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
>.info {
|
|
188
188
|
width: 100%;
|
|
189
189
|
margin-right: -200px;
|
|
190
|
-
line-height:
|
|
190
|
+
line-height: 1;
|
|
191
191
|
text-align: left;
|
|
192
192
|
padding: 46px 5px 0 5px;
|
|
193
193
|
z-index: 2;
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
|
|
261
261
|
&.page>.krc {
|
|
262
262
|
text-align: center;
|
|
263
|
-
line-height:
|
|
263
|
+
line-height: 2.2;
|
|
264
264
|
margin-bottom: -80px;
|
|
265
265
|
bottom: 50%;
|
|
266
266
|
height: 180px;
|
package/coms/layer/glance.js
CHANGED
|
@@ -13,7 +13,7 @@ var dragview = function (dragview) {
|
|
|
13
13
|
moving = false;
|
|
14
14
|
} else {
|
|
15
15
|
var { childNodes } = target;
|
|
16
|
-
if (getComputedStyle(target).cursor === 'auto') for (var cx = 0, dx = childNodes.length; cx < dx; cx++) {
|
|
16
|
+
if (getComputedStyle(target).cursor === 'auto' && getComputedStyle(target).userSelect !== 'none') for (var cx = 0, dx = childNodes.length; cx < dx; cx++) {
|
|
17
17
|
var child = childNodes[cx];
|
|
18
18
|
if (child.nodeType === 3) {
|
|
19
19
|
moving = false;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
*{
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
1
4
|
& {
|
|
2
5
|
background: #fff;
|
|
3
6
|
display: inline-block;
|
|
4
7
|
resize: both;
|
|
5
|
-
font-
|
|
8
|
+
font-size: 16px;
|
|
6
9
|
position: relative;
|
|
7
10
|
min-height: 100px;
|
|
8
11
|
padding: 0 0 10px 16px;
|
|
9
12
|
font-family: 宋体;
|
|
10
|
-
width:
|
|
13
|
+
width: 422px;
|
|
11
14
|
|
|
12
15
|
>a {
|
|
13
16
|
display: inline-block;
|
package/coms/zimoli/audio.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
var alertError = alert.bind(null, 'error');
|
|
2
|
-
var Context = window.webkitAudioContext || window.AudioContext;
|
|
3
|
-
var globalContext = Context && new Context;
|
|
4
2
|
|
|
5
3
|
var reportError = function (error) {
|
|
6
4
|
switch (error.code || error.name) {
|
|
@@ -25,85 +23,68 @@ var reportError = function (error) {
|
|
|
25
23
|
|
|
26
24
|
function init() {
|
|
27
25
|
if (!this.audioPromise) {
|
|
28
|
-
this.audioPromise =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}).then((stream) => {
|
|
33
|
-
var context = new Context;
|
|
26
|
+
this.audioPromise = navigator.mediaDevices.getUserMedia({
|
|
27
|
+
audio: { deviceId: this.deviceId }
|
|
28
|
+
}).then(async (stream) => {
|
|
29
|
+
var context = new AudioContext;
|
|
34
30
|
this.gain = context.createGain();
|
|
31
|
+
var analyser = context.createAnalyser();
|
|
32
|
+
analyser.fftSize = 2048;
|
|
35
33
|
context.resume();
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
var createScript = context.createScriptProcessor || context.createJavaScriptNode;
|
|
39
|
-
var recorder = createScript.apply(context, [0, 1, 1]);
|
|
40
|
-
return [recorder, audioInput, context];
|
|
34
|
+
var source = context.createMediaStreamSource(stream);
|
|
35
|
+
return [source, context, analyser];
|
|
41
36
|
});
|
|
42
37
|
}
|
|
43
38
|
return this.audioPromise;
|
|
44
39
|
}
|
|
45
|
-
|
|
40
|
+
|
|
41
|
+
async function stop() {
|
|
46
42
|
var commandCount = ++this.commandCount;
|
|
47
43
|
if (!this.running) return;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
var [source, context, analyser] = await this.init();
|
|
45
|
+
cancelAnimationFrame(analyser.frame);
|
|
46
|
+
if (this.commandCount !== commandCount) return;
|
|
47
|
+
this.running = false;
|
|
48
|
+
source.disconnect(analyser);
|
|
49
|
+
if (this.gain) {
|
|
50
|
+
source.disconnect(this.gain);
|
|
51
|
+
this.gain.disconnect(context.destination);
|
|
52
|
+
} else {
|
|
53
|
+
source.disconnect(context.destination);
|
|
54
|
+
}
|
|
55
|
+
this.context = null;
|
|
56
|
+
this.audioPromise = null;
|
|
57
|
+
this.gain = null;
|
|
58
|
+
context.suspend();
|
|
59
|
+
await context.close();
|
|
60
|
+
if (this.audio) this.audio.pause();
|
|
62
61
|
}
|
|
63
|
-
|
|
62
|
+
|
|
63
|
+
async function start() {
|
|
64
64
|
if (this.running) return;
|
|
65
65
|
var commandCount = ++this.commandCount;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var buffer = copyData(e);
|
|
71
|
-
cast(this, buffer);
|
|
72
|
-
this.onprocess instanceof Function && this.onprocess(buffer);
|
|
73
|
-
};
|
|
74
|
-
this.running = true;
|
|
75
|
-
audioInput.connect(recorder);
|
|
76
|
-
recorder.connect(this.gain).connect(context.destination);
|
|
77
|
-
if (this.audio) this.audio.play();
|
|
78
|
-
}).catch(reportError);
|
|
79
|
-
}
|
|
80
|
-
function copyData(audioProcessingEvent) {
|
|
81
|
-
// The input buffer is the song we loaded earlier
|
|
82
|
-
var inputBuffer = audioProcessingEvent.inputBuffer;
|
|
83
|
-
|
|
84
|
-
// The output buffer contains the samples that will be modified and played
|
|
85
|
-
var outputBuffer = audioProcessingEvent.outputBuffer;
|
|
86
|
-
var distBuffer = [];
|
|
87
|
-
// Loop through the output channels (in this case there is only one)
|
|
88
|
-
var { numberOfChannels } = inputBuffer;
|
|
89
|
-
for (var channel = 0; channel < numberOfChannels; channel++) {
|
|
90
|
-
var inputData = inputBuffer.getChannelData(channel);
|
|
91
|
-
var outputData = outputBuffer.getChannelData(channel);
|
|
92
|
-
|
|
93
|
-
// Loop through the 4096 samples
|
|
94
|
-
for (var cx = 0, dx = inputData.length; cx < dx; cx++) {
|
|
95
|
-
// make output equal to the same as the input
|
|
96
|
-
outputData[cx] = inputData[cx];
|
|
97
|
-
if (!distBuffer[cx]) distBuffer[cx] = inputData[cx];
|
|
98
|
-
else distBuffer[cx] += inputData[cx];
|
|
99
|
-
|
|
100
|
-
// add noise to each output sample
|
|
101
|
-
// outputData[cx] += ((Math.random() * 2) - 1) * 0.2;
|
|
102
|
-
|
|
103
|
-
}
|
|
66
|
+
try {
|
|
67
|
+
var [source, context, analyser] = await this.init();
|
|
68
|
+
} catch (e) {
|
|
69
|
+
reportError(e);
|
|
104
70
|
}
|
|
105
|
-
|
|
71
|
+
if (commandCount !== this.commandCount) return;
|
|
72
|
+
this.context = context;
|
|
73
|
+
var dancingArray = new Uint8Array(analyser.fftSize);
|
|
74
|
+
var animate = () => {
|
|
75
|
+
analyser.getByteTimeDomainData(dancingArray);
|
|
76
|
+
cast(this, dancingArray);
|
|
77
|
+
analyser.frame = requestAnimationFrame(animate);
|
|
78
|
+
this.onprocess instanceof Function && this.onprocess(dancingArray);
|
|
79
|
+
};
|
|
80
|
+
animate();
|
|
81
|
+
this.running = true;
|
|
82
|
+
|
|
83
|
+
source.connect(analyser);
|
|
84
|
+
source.connect(this.gain).connect(context.destination);
|
|
85
|
+
if (this.audio) this.audio.play();
|
|
106
86
|
}
|
|
87
|
+
|
|
107
88
|
class Source {
|
|
108
89
|
running = false;
|
|
109
90
|
audioPromise;
|
|
@@ -119,7 +100,7 @@ class Source {
|
|
|
119
100
|
}
|
|
120
101
|
init() {
|
|
121
102
|
if (this.audioPromise) return this.audioPromise;
|
|
122
|
-
var context = new
|
|
103
|
+
var context = new AudioContext;
|
|
123
104
|
var audio = document.createElement("audio");
|
|
124
105
|
this.gain = context.createGain();
|
|
125
106
|
console.log(this.gain);
|
|
@@ -131,9 +112,10 @@ class Source {
|
|
|
131
112
|
|
|
132
113
|
return this.audioPromise = Promise.resolve([recorder, source, context]);
|
|
133
114
|
}
|
|
134
|
-
start = start;
|
|
135
|
-
stop = stop;
|
|
136
115
|
}
|
|
116
|
+
Source.prototype.start = start;
|
|
117
|
+
Source.prototype.stop = stop;
|
|
118
|
+
|
|
137
119
|
class Recorder {
|
|
138
120
|
running = false;
|
|
139
121
|
hasMicrophone = navigator.getUserMedia instanceof Function;
|
|
@@ -141,6 +123,8 @@ class Recorder {
|
|
|
141
123
|
commandCount = 0;
|
|
142
124
|
onprocess;
|
|
143
125
|
context;
|
|
126
|
+
workletUrl;
|
|
127
|
+
workletName;
|
|
144
128
|
constructor(device) {
|
|
145
129
|
if (!device) device = {};
|
|
146
130
|
var config = {
|
|
@@ -154,10 +138,11 @@ class Recorder {
|
|
|
154
138
|
|
|
155
139
|
extend(this, config);
|
|
156
140
|
}
|
|
157
|
-
init = init;
|
|
158
|
-
start = start;
|
|
159
|
-
stop = stop;
|
|
160
141
|
}
|
|
142
|
+
Recorder.prototype.init = init;
|
|
143
|
+
Recorder.prototype.start = start;
|
|
144
|
+
Recorder.prototype.stop = stop;
|
|
145
|
+
|
|
161
146
|
class Monitor {
|
|
162
147
|
running = false;
|
|
163
148
|
context;
|
|
@@ -171,19 +156,16 @@ class Monitor {
|
|
|
171
156
|
extend(this, config);
|
|
172
157
|
|
|
173
158
|
}
|
|
174
|
-
init = init;
|
|
175
|
-
start = start;
|
|
176
|
-
stop = stop;
|
|
177
159
|
}
|
|
160
|
+
Monitor.prototype.init = init;
|
|
161
|
+
Monitor.prototype.start = start;
|
|
162
|
+
Monitor.prototype.stop = stop;
|
|
163
|
+
|
|
178
164
|
var audio = {
|
|
179
165
|
Recorder,
|
|
180
166
|
Monitor,
|
|
181
167
|
Source,
|
|
182
|
-
Context,
|
|
183
|
-
copyData,
|
|
184
|
-
getGlobalContext() {
|
|
185
|
-
return globalContext;
|
|
186
|
-
},
|
|
168
|
+
Context: AudioContext,
|
|
187
169
|
getRecorder() {
|
|
188
170
|
return new Recorder
|
|
189
171
|
},
|
|
@@ -13,10 +13,8 @@ function main() {
|
|
|
13
13
|
context.beginPath();
|
|
14
14
|
context.moveTo(0, canvas.offsetHeight / 2);
|
|
15
15
|
var max = 2;
|
|
16
|
-
// [].forEach.call(buffer, function (db, cx) {
|
|
17
|
-
// if (db > max) max = db;
|
|
18
|
-
// });
|
|
19
16
|
[].forEach.call(buffer, function (db, cx) {
|
|
17
|
+
db = (db - 128) / 128;
|
|
20
18
|
context.lineTo(cx * canvas.width / buffer.length, canvas.height / 2 - db / max * canvas.height);
|
|
21
19
|
});
|
|
22
20
|
context.stroke();
|
package/coms/zimoli/bind.js
CHANGED
|
@@ -5,12 +5,11 @@ function bind(eventName, bindTo = window) {
|
|
|
5
5
|
if (off) off();
|
|
6
6
|
off = on(eventName).call(bindTo, target, eventListener);
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
var off1 = on("append")(target, mount);
|
|
8
|
+
var off1 = onmounted(target, mount);
|
|
10
9
|
var off2 = on("remove")(target, function () {
|
|
11
10
|
if (off) off();
|
|
12
11
|
off = null;
|
|
13
12
|
});
|
|
14
|
-
return function () { off1(); off2(); };
|
|
13
|
+
return function () { off1(); off2(); if (off) off(); };
|
|
15
14
|
}
|
|
16
15
|
}
|
package/coms/zimoli/lattice.js
CHANGED
|
@@ -53,18 +53,9 @@ function lattice(element, minWidth, maxWidth = minWidth << 1, layers) {
|
|
|
53
53
|
if (element.with instanceof Array) element.with.forEach(build);
|
|
54
54
|
else if (isElement(element.with)) build(element.with);
|
|
55
55
|
};
|
|
56
|
-
var go = _box.go;
|
|
57
|
-
_box.go = function (value) {
|
|
58
|
-
resize();
|
|
59
|
-
if (!boxCount) return;
|
|
60
|
-
go.call(_box, value);
|
|
61
|
-
};
|
|
62
|
-
var _onappend = function () {
|
|
63
|
-
_box.resize();
|
|
64
|
-
};
|
|
65
|
-
onappend(_box, _onappend);
|
|
66
56
|
_box.resize = lazy(function () {
|
|
67
57
|
var savedCount = boxCount;
|
|
58
|
+
console.log(savedCount)
|
|
68
59
|
var index = _box.index();
|
|
69
60
|
resize();
|
|
70
61
|
if (savedCount === boxCount) return;
|
|
@@ -74,8 +65,8 @@ function lattice(element, minWidth, maxWidth = minWidth << 1, layers) {
|
|
|
74
65
|
[].forEach.call(_box.children, function (c) {
|
|
75
66
|
build(c);
|
|
76
67
|
});
|
|
77
|
-
go
|
|
78
|
-
}
|
|
68
|
+
_box.go(index);
|
|
69
|
+
});
|
|
79
70
|
resizingList.set(_box);
|
|
80
71
|
on('resize')(_box, _box.resize);
|
|
81
72
|
return _box;
|
package/coms/zimoli/model.less
CHANGED
package/coms/zimoli/onmounted.js
CHANGED
package/coms/zimoli/picture.js
CHANGED
|
@@ -38,7 +38,7 @@ var create = function (url, key) {
|
|
|
38
38
|
image.shape = function (x, y, scaled, rotate) {
|
|
39
39
|
var style = get_style(x, y, scaled, rotate);
|
|
40
40
|
css(imgpic, style);
|
|
41
|
-
if (imgpic) dispatch(
|
|
41
|
+
if (imgpic) dispatch(p, 'scaled');
|
|
42
42
|
};
|
|
43
43
|
image.close = function () {
|
|
44
44
|
if (!p.touchclose) return false;
|
package/coms/zimoli/popup.js
CHANGED
|
@@ -99,8 +99,7 @@ var popup_path = function (path = "", parameters, target) {
|
|
|
99
99
|
element.$reload = fullfill;
|
|
100
100
|
if (!target && target !== false && parameters !== false) {
|
|
101
101
|
element.style.opacity = 0;
|
|
102
|
-
|
|
103
|
-
else once('append')(element, function () {
|
|
102
|
+
oncemount(element, function () {
|
|
104
103
|
move.bindPosition(element, [.5, .5]);
|
|
105
104
|
element.style.opacity = 1;
|
|
106
105
|
});
|
package/coms/zimoli/render.js
CHANGED
|
@@ -573,6 +573,7 @@ var createEmiter = function (on) {
|
|
|
573
573
|
getter1 = createGetter(search, false);
|
|
574
574
|
}
|
|
575
575
|
on(key)(this, function (e) {
|
|
576
|
+
digest();
|
|
576
577
|
if (parsedSrc) {
|
|
577
578
|
var target = e.currentTarget || e.target;
|
|
578
579
|
var scopes = target && target.$parentScopes;
|
|
@@ -601,7 +602,6 @@ var createEmiter = function (on) {
|
|
|
601
602
|
res = getter0.call(this, e);
|
|
602
603
|
}
|
|
603
604
|
if (res && isFunction(res.then)) res.then(digest, digest);
|
|
604
|
-
digest();
|
|
605
605
|
return res;
|
|
606
606
|
});
|
|
607
607
|
};
|
package/coms/zimoli/resize.js
CHANGED
|
@@ -135,39 +135,36 @@ function resize(elem, initialEvent) {
|
|
|
135
135
|
}
|
|
136
136
|
moveupon(window, handle);
|
|
137
137
|
|
|
138
|
+
var offmousemove;
|
|
139
|
+
var resizeh = lazy(function () {
|
|
140
|
+
// 用于刷新自定义的scrollbar/lattice/gallery组件
|
|
141
|
+
var elem = this;
|
|
142
|
+
var resized = false;
|
|
143
|
+
if (elem.scrollWidth > elem.clientWidth) {
|
|
144
|
+
css(elem, { width: elem.offsetWidth });
|
|
145
|
+
resized = true;
|
|
146
|
+
}
|
|
147
|
+
if (elem.scrollHeight > elem.clientHeight) {
|
|
148
|
+
css(elem, { height: elem.offsetHeight });
|
|
149
|
+
resized = true;
|
|
150
|
+
}
|
|
151
|
+
if (resized) dispatch(elem, 'resize'), resizingList.hit(elem);
|
|
152
|
+
});
|
|
138
153
|
|
|
139
154
|
resize.on = function (elem, dragHandle) {
|
|
140
155
|
if (elem) {
|
|
141
156
|
elem.dragHandle = dragHandle;
|
|
142
157
|
}
|
|
143
158
|
onmounted(elem, function () {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var computed = getComputedStyle(elem);
|
|
148
|
-
var resizeh = function () {
|
|
149
|
-
var elem = this;
|
|
150
|
-
var resized = false;
|
|
151
|
-
if (elem.scrollWidth > elem.clientWidth) {
|
|
152
|
-
css(elem, { width: elem.offsetWidth });
|
|
153
|
-
resized = true;
|
|
159
|
+
if (!offmousemove) offmousemove = onmousemove(window, getResizer);
|
|
160
|
+
if (!~resizingElements.indexOf(elem)) {
|
|
161
|
+
resizingElements.push(elem);
|
|
154
162
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (
|
|
160
|
-
if (
|
|
161
|
-
|
|
162
|
-
unbind = null;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
if (!parseInt(computed.height) || !parseInt(computed.width)) var unbind = bind('render')(elem, resizeh);
|
|
166
|
-
if (!~resizingElements.indexOf(elem)) {
|
|
167
|
-
resizingElements.push(elem);
|
|
168
|
-
once('remove')(elem, function () {
|
|
169
|
-
var index = resizingElements.indexOf(this);
|
|
170
|
-
if (~index) resizingElements.splice(index, 1);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
163
|
+
bind('render')(elem, resizeh);
|
|
164
|
+
});
|
|
165
|
+
on('remove')(elem, function () {
|
|
166
|
+
var index = resizingElements.indexOf(this);
|
|
167
|
+
if (~index) resizingElements.splice(index, 1);
|
|
168
|
+
if (!resizingElements.length && offmousemove) offmousemove(), offmousemove = null;
|
|
169
|
+
});
|
|
173
170
|
};
|
package/coms/zimoli/script.js
CHANGED
package/coms/zimoli/scrollbar.js
CHANGED
|
@@ -144,8 +144,8 @@ var scrollbary = function () {
|
|
|
144
144
|
function bindTarget(_container, followResize = _container) {
|
|
145
145
|
var _scrollbar = this;
|
|
146
146
|
_container.with = _scrollbar;
|
|
147
|
-
onappend(_container, _scrollbar.reshape);
|
|
148
147
|
_scrollbar.target = _container;
|
|
148
|
+
onmounted(_container, _scrollbar.reshape);
|
|
149
149
|
on("scroll")(_container, function () {
|
|
150
150
|
var top = getTargetTop(_container);
|
|
151
151
|
_scrollbar.scrollTo(top);
|