efront 4.22.13 → 4.22.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.
@@ -269,34 +269,25 @@ function tree() {
269
269
  }
270
270
  var stickys = [];
271
271
  var setSticky = function () {
272
- var p = stickys[stickys.length - 1];
273
- var f = banner.getFirstVisibleElement(stickys.top);
272
+ var top = stickys.top || 0;
273
+ var f = banner.getFirstVisibleElement(top);
274
274
  if (!f) return;
275
- var limitHeight = f.offsetTop - banner.scrollTop - parseFloat(getComputedStyle(banner).paddingTop);
276
- var c = dom[f.$index];
277
- var useLimit = false;
278
- if (p) {
279
- var d = dom[p.$index];
280
- if (d.tab == c.tab) {
281
- var { top, height } = getOffset(p);
282
- if (top + height >= limitHeight) {
283
- var ic = c.parent.indexOf(c);
284
- useLimit = c.parent[ic - 1] === d;
285
- if (useLimit) c = d;
286
- }
287
- }
288
- else {
289
- useLimit = true;
290
- limitHeight += getOffset(f).height;
291
- }
292
- }
275
+ var i = f.$index;
276
+ if (top > 0 && dom[i - 1]?.tab > dom[i].tab) i--;
277
+ var c = dom[i++];
278
+ while (i < dom.length && c.tab <= dom[i].tab) i++;
279
+ var n = dom[i]?.$target;
280
+ var limitHeight = n && n.offsetTop ? n.offsetTop - banner.scrollTop - parseFloat(getComputedStyle(banner).paddingTop) : Infinity;
293
281
  var parents = [];
294
282
  if (c.isClosed() || !c.length) c = c.parent;
295
283
  while (c.parent) {
296
284
  var p = c.parent;
297
285
  if (!p?.joined) {
298
- if (!c.$target) return;
299
- parents.push(c);
286
+ var ct = c.$target;
287
+ if (!ct) break;
288
+ var pt = p.$target;
289
+ if (pt && ct.offsetTop > pt.offsetTop + pt.offsetHeight);
290
+ else parents.push(c);
300
291
  }
301
292
  c = p;
302
293
  }
@@ -319,11 +310,11 @@ function tree() {
319
310
  var top = 0;
320
311
  stickys.forEach(p => {
321
312
  var h = getOffset(p).height;
322
- var limit = useLimit && top + h > limitHeight;
313
+ var limit = top + h > limitHeight;
323
314
  css(p, {
324
315
  position: 'sticky',
325
- zIndex: 2,
326
- top: limit ? limitHeight - h : top, zIndex: 3 - limit
316
+ top: limit ? limitHeight - h : top,
317
+ zIndex: 3 - limit
327
318
  });
328
319
  top += h;
329
320
  });
@@ -4,3 +4,4 @@ function zIndex(inc = 1) {
4
4
  if (inc > 0) count += inc;
5
5
  return count;
6
6
  };
7
+ zIndex.start = count;
package/docs/main.xht CHANGED
@@ -1,5 +1,5 @@
1
1
  <style>
2
- :root {
2
+ :scope {
3
3
  --leftwidth: 260px;
4
4
  display: block;
5
5
  width: auto;
@@ -14,39 +14,39 @@
14
14
  background: #fff;
15
15
  }
16
16
 
17
- :root+scrollbar {
17
+ :scope+scrollbar {
18
18
  right: 0;
19
19
  background: transparent;
20
20
  }
21
21
 
22
- :root>* {
22
+ :scope>* {
23
23
  vertical-align: top;
24
24
  }
25
25
 
26
- :root>menu f {
26
+ :scope>menu f {
27
27
  margin-left: 6px;
28
28
  }
29
29
 
30
- :root>menu f[test]:before {
30
+ :scope>menu f[test]:before {
31
31
  color: #fc0;
32
32
  content: "测";
33
33
  }
34
34
 
35
- :root>menu f[dang]:before {
35
+ :scope>menu f[dang]:before {
36
36
  color: #2cf;
37
37
  content: "档";
38
38
  }
39
39
 
40
- :root>menu f[less]:before {
40
+ :scope>menu f[less]:before {
41
41
  color: #2c9;
42
42
  content: "样";
43
43
  }
44
44
 
45
- :root>menu[inline] {
45
+ :scope>menu[inline] {
46
46
  height: 100%;
47
47
  }
48
48
 
49
- :root>menu[inline] {
49
+ :scope>menu[inline] {
50
50
  margin: 0;
51
51
  width: var(--leftwidth);
52
52
  margin-left: -var(--leftwidth);
@@ -81,7 +81,7 @@
81
81
  background: linear-gradient(#f2f4ff, 70%, #e9fff2);
82
82
  }
83
83
 
84
- :root>menu v {
84
+ :scope>menu v {
85
85
  display: inline-block;
86
86
  font-size: 12px;
87
87
  color: #79a;
@@ -99,11 +99,11 @@
99
99
  z-index: 0 !important;
100
100
  }
101
101
 
102
- :root>open:after {
102
+ :scope>open:after {
103
103
  content: "≡";
104
104
  }
105
105
 
106
- :root>open {
106
+ :scope>open {
107
107
 
108
108
  display: block;
109
109
  position: absolute;
@@ -121,7 +121,7 @@
121
121
  border-radius: 50%;
122
122
  }
123
123
 
124
- :root>menu {
124
+ :scope>menu {
125
125
 
126
126
  position: absolute;
127
127
  z-index: -1;
@@ -150,7 +150,7 @@
150
150
 
151
151
  }
152
152
 
153
- :root {
153
+ :scope {
154
154
  padding: 0px !important;
155
155
  }
156
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.22.13",
3
+ "version": "4.22.16",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {