efront 3.25.12 → 3.25.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.
@@ -74,16 +74,29 @@ function alert() {
74
74
  if (close_timer) clearTimeout(close_timer);
75
75
  }
76
76
  onremove(elem, _onclose);
77
- if (autoclose) {
78
- if (autoclose === true) {
79
- autoclose = text.length * 200 + 400;
80
- } else if (autoclose < 100) {
81
- autoclose = autoclose * 1000;
77
+ var close_timer;
78
+ var waitclose = function (autoclose, deltaTime) {
79
+ if (autoclose) {
80
+ if (autoclose === true) {
81
+ autoclose = text.length * 160 + deltaTime;
82
+ } else if (autoclose < 100) {
83
+ autoclose = autoclose * 1000;
84
+ }
85
+ close_timer = setTimeout(function () {
86
+ remove(elem);
87
+ }, autoclose);
82
88
  }
83
- var close_timer = setTimeout(function () {
84
- remove(elem);
85
- }, autoclose);
86
- }
89
+ };
90
+ waitclose(autoclose, 400)
91
+ elem.setText = function (content, timeout = true) {
92
+ var c = elem.children[0];
93
+ c.innerHTML = content;
94
+ text = content;
95
+ if (timeout) {
96
+ clearTimeout(close_timer);
97
+ waitclose(timeout, -100);
98
+ }
99
+ };
87
100
  alerts.push(elem);
88
101
  popup(elem);
89
102
  return elem;
@@ -122,6 +122,7 @@ appendChild(广告, alink);
122
122
  function picture(url, to = 0, key) {
123
123
 
124
124
  var images = {};
125
+ var cacheLength = 8;
125
126
  var gen = function (index, ratio) {
126
127
  if (index >= urls.length || index < 0) return null;
127
128
  if (images[index] && images[index].url !== urls[index]) {
@@ -133,9 +134,9 @@ function picture(url, to = 0, key) {
133
134
  if (!images[index + 1] && index + 1 < urls.length) {
134
135
  images[index + 1] = create.call(p, urls[index + 1], key, p.index === index);
135
136
  }
136
- if (index >= 5) delete images[index - 5];
137
- if (index + 5 < urls.length) {
138
- delete images[index + 5];
137
+ if (index >= cacheLength) delete images[index - cacheLength];
138
+ if (index + cacheLength < urls.length) {
139
+ delete images[index + cacheLength];
139
140
  }
140
141
  var img = images[index]
141
142
  if (ratio > .75 && img) {
@@ -667,7 +667,6 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
667
667
  element.renders = element.renders ? [].concat(element.renders) : [];
668
668
  var { ons, copys, attrs, props, binds, context: withContext, ids, once } = element.$struct;
669
669
  if (once) element.renderid = 9;
670
- delete element.$struct;
671
670
  if (binds.src) {
672
671
  element.$src = parseRepeat(binds.src);
673
672
  }
@@ -710,12 +709,14 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
710
709
  if (replacer.renders) renders = renders.concat(replacer.renders);
711
710
  replacer.renders = renders;
712
711
  if (binds.src) replacer.$src = element.$src;
712
+ delete element.$struct;
713
713
  element = replacer;
714
714
  element.$scope = scope;
715
715
  element.$parentScopes = parentScopes;
716
716
  }
717
717
  }
718
718
  }
719
+ delete element.$struct;
719
720
  if (element.children && element.children.length) renderElement(element.children, scope, parentScopes, once);
720
721
  if (!isFirstRender) return element;
721
722
  var renders = element.renders;
@@ -900,3 +901,6 @@ render.register = function (key, name) {
900
901
  register(key, name);
901
902
  }
902
903
  };
904
+ render.style = function (element, search) {
905
+ return directives.style.call(element, search);
906
+ }
@@ -359,12 +359,16 @@ function table(elem) {
359
359
  var tds = getTdsOfSameRow(td);
360
360
  setClass(tds, 'x-ing', activeRows);
361
361
  activeRows = tds;
362
- return;
363
362
  }
364
363
  if (!thead) {
365
364
  thead = getThead(table);
366
365
  }
367
- if (!getTargetIn(thead, event.target)) return;
366
+ if (!getTargetIn(thead, event.target)) {
367
+ activeCols.forEach(function (td) {
368
+ removeClass(td, 'y-ing');
369
+ });
370
+ return;
371
+ }
368
372
  var tds = getTargetIn(cellMatchManager, event.target);
369
373
  if (!tds) return;
370
374
  setClass(tds, 'y-ing', activeCols);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.25.12",
3
+ "version": "3.25.14",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {