easy 23.1.0 → 23.1.3
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/example.js +137 -137
- package/lib/constants.js +24 -24
- package/lib/element/button.js +1 -1
- package/lib/element/checkbox.js +1 -1
- package/lib/element/input.js +1 -1
- package/lib/element/link.js +1 -1
- package/lib/element/select.js +1 -1
- package/lib/element/textarea.js +1 -1
- package/lib/element.js +15 -15
- package/lib/eventTypes.js +32 -32
- package/lib/example/view.js +1 -1
- package/lib/index.js +23 -23
- package/lib/mixins/element.js +9 -9
- package/lib/mixins/scroll.js +5 -5
- package/lib/mouseButtons.js +6 -6
- package/lib/utilities/array.js +7 -7
- package/lib/utilities/dom.js +8 -8
- package/lib/utilities/element.js +7 -7
- package/lib/utilities/elements.js +4 -4
- package/lib/utilities/name.js +5 -5
- package/lib/utilities/object.js +4 -4
- package/package.json +1 -1
- package/src/element.js +18 -21
package/src/element.js
CHANGED
|
@@ -253,38 +253,35 @@ export default class Element {
|
|
|
253
253
|
|
|
254
254
|
css(css = null) {
|
|
255
255
|
if (css === null) {
|
|
256
|
-
|
|
257
|
-
css = {};
|
|
256
|
+
css = {};
|
|
258
257
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
const computedStyles = getComputedStyle(this.domElement); ///
|
|
259
|
+
|
|
260
|
+
for (let index = 0; index < computedStyles.length; index++) {
|
|
261
|
+
const computedStyle = computedStyles[index],
|
|
262
|
+
name = computedStyle, ///
|
|
263
|
+
value = computedStyles.getPropertyValue(name); ///
|
|
263
264
|
|
|
264
265
|
css[name] = value;
|
|
265
266
|
}
|
|
266
|
-
|
|
267
|
-
return css;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (typeof css === STRING) {
|
|
267
|
+
} else if (typeof css === STRING) {
|
|
271
268
|
let name = css; ///
|
|
272
269
|
|
|
273
|
-
const
|
|
274
|
-
value =
|
|
270
|
+
const computedStyles = getComputedStyle(this.domElement), ///
|
|
271
|
+
value = computedStyles.getPropertyValue(name); ///
|
|
275
272
|
|
|
276
273
|
css = value; ///
|
|
274
|
+
} else {
|
|
275
|
+
const names = Object.keys(css); ///
|
|
277
276
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const names = Object.keys(css); ///
|
|
277
|
+
names.forEach((name) => {
|
|
278
|
+
const value = css[name];
|
|
282
279
|
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
this.style(name, value);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
285
283
|
|
|
286
|
-
|
|
287
|
-
});
|
|
284
|
+
return css;
|
|
288
285
|
}
|
|
289
286
|
|
|
290
287
|
destroy() {
|