efront 3.12.4 → 3.12.5
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/zimoli/css.js +13 -5
- package/coms/zimoli/data.js +1 -1
- package/coms/zimoli/select.js +3 -3
- package/coms/zimoli/slider.js +13 -6
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/zimoli/css.js
CHANGED
|
@@ -19,9 +19,15 @@ var transfromSimpleValue = function (value) {
|
|
|
19
19
|
};
|
|
20
20
|
var transformValue = function (value, k) {
|
|
21
21
|
if (ratioPropReg.test(k) || !value) return value;
|
|
22
|
-
if (/^[\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s
|
|
22
|
+
if (/^[\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s+/).map(transfromSimpleValue).join(' ');
|
|
23
23
|
return value;
|
|
24
24
|
};
|
|
25
|
+
var partifyValue = function (v) {
|
|
26
|
+
return String(v).toLowerCase().split(/['"`]|\s+/).join(" ");
|
|
27
|
+
};
|
|
28
|
+
var isSameValue = function (v1, v2) {
|
|
29
|
+
return partifyValue(v1) === partifyValue(v2);
|
|
30
|
+
};
|
|
25
31
|
/**
|
|
26
32
|
* 将中划线转成驼峰式
|
|
27
33
|
* @param {string} key
|
|
@@ -86,7 +92,8 @@ var cssTargetNode = function (targetNode, oStyle, oValue) {
|
|
|
86
92
|
var key = transformNodeKey(k);
|
|
87
93
|
if (key in styleobject) {
|
|
88
94
|
try {
|
|
89
|
-
|
|
95
|
+
var value = transformValue(oStyle[k], key);
|
|
96
|
+
if (!isSameValue(value, styleobject[value])) styleobject[key] = transformValue(oStyle[k], key);
|
|
90
97
|
} catch (e) {
|
|
91
98
|
console.warn(key, oStyle[k], "无效");
|
|
92
99
|
}
|
|
@@ -95,7 +102,8 @@ var cssTargetNode = function (targetNode, oStyle, oValue) {
|
|
|
95
102
|
} else {
|
|
96
103
|
for (var k in oStyle) {
|
|
97
104
|
var key = transformNodeKey(k);
|
|
98
|
-
|
|
105
|
+
var value = transformValue(oStyle[k], key);
|
|
106
|
+
if (key in styleobject && !isSameValue(value, styleobject[key])) styleobject[key] = value;
|
|
99
107
|
}
|
|
100
108
|
}
|
|
101
109
|
}
|
|
@@ -153,9 +161,9 @@ function cssTargetStyleSheet(stylesheet, innerCss) {
|
|
|
153
161
|
var styleSheet = stylesheet.styleSheet;
|
|
154
162
|
if (styleSheet) {
|
|
155
163
|
//IE
|
|
156
|
-
styleSheet.cssText = innerCss;
|
|
164
|
+
if (styleSheet.cssText !== innerCss) styleSheet.cssText = innerCss;
|
|
157
165
|
} else {
|
|
158
|
-
stylesheet.innerHTML = innerCss;
|
|
166
|
+
if (stylesheet.innerHTML !== innerCss) stylesheet.innerHTML = innerCss;
|
|
159
167
|
}
|
|
160
168
|
}
|
|
161
169
|
|
package/coms/zimoli/data.js
CHANGED
package/coms/zimoli/select.js
CHANGED
|
@@ -42,12 +42,12 @@ function select(target, list, removeOnSelect, direction) {
|
|
|
42
42
|
direction = removeOnSelect;
|
|
43
43
|
removeOnSelect = arguments[3];
|
|
44
44
|
}
|
|
45
|
-
if (direction === undefined) {
|
|
46
|
-
direction = target.getAttribute("direction") || target.direction;
|
|
47
|
-
}
|
|
48
45
|
if (!target) {
|
|
49
46
|
target = document.createElement("select");
|
|
50
47
|
}
|
|
48
|
+
if (direction === undefined) {
|
|
49
|
+
direction = target.getAttribute("direction") || target.direction;
|
|
50
|
+
}
|
|
51
51
|
target.tabIndex = 0;
|
|
52
52
|
onblur(target, removeByBlur);
|
|
53
53
|
if (/select/i.test(target.tagName)) {
|
package/coms/zimoli/slider.js
CHANGED
|
@@ -122,17 +122,23 @@ function slider(autoplay, circle = true) {
|
|
|
122
122
|
};
|
|
123
123
|
var park = function () {
|
|
124
124
|
direction = 0;
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
var singleTarget = getSingleTarget();
|
|
126
|
+
if (singleTarget) {
|
|
127
|
+
negative_index = round(negative_index);
|
|
128
|
+
}
|
|
129
|
+
else if (delta_negative_index > 0) {
|
|
130
|
+
if (negative_index - floor(negative_index) > 0.2 / (1 + 6 * abs(_speed())))
|
|
127
131
|
negative_index = ceil(negative_index);
|
|
128
132
|
else
|
|
129
133
|
negative_index = floor(negative_index);
|
|
130
|
-
}
|
|
131
|
-
|
|
134
|
+
}
|
|
135
|
+
else if (delta_negative_index < 0) {
|
|
136
|
+
if (ceil(negative_index) - negative_index > 0.2 / (1 + 6 * abs(_speed())))
|
|
132
137
|
negative_index = floor(negative_index);
|
|
133
138
|
else
|
|
134
139
|
negative_index = ceil(negative_index);
|
|
135
|
-
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
136
142
|
negative_index = round(negative_index);
|
|
137
143
|
}
|
|
138
144
|
animate();
|
|
@@ -173,9 +179,10 @@ function slider(autoplay, circle = true) {
|
|
|
173
179
|
}
|
|
174
180
|
return enabled;
|
|
175
181
|
};
|
|
182
|
+
var getSingleTarget = () => (!_imageMain || !_imageHelp) && (_imageMain || _imageHelp);
|
|
176
183
|
var moveDeltaX = function (deltax, event) {
|
|
177
184
|
var width = outter.clientWidth;
|
|
178
|
-
var singleTarget = (
|
|
185
|
+
var singleTarget = getSingleTarget();
|
|
179
186
|
if (singleTarget) {
|
|
180
187
|
var current_Left = singleTarget.offsetLeft;
|
|
181
188
|
var avail_deltaWidth = round(width >> 2);
|