MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / _css

Function _css

src/components/Workspace/Layer/index.jsx:138–158  ·  view source on GitHub ↗
(el, prop, val)

Source from the content-addressed store, hash-verified

136 e.preventDefault()
137 }
138 function _css (el, prop, val) {
139 const style = el && el.style;
140
141 if (style) {
142 if (val === void 0) {
143 if (document.defaultView && document.defaultView.getComputedStyle) {
144 val = document.defaultView.getComputedStyle(el, '');
145 } else if (el.currentStyle) {
146 val = el.currentStyle;
147 }
148
149 return prop === void 0 ? val : val[prop];
150 }
151 if (!(prop in style)) {
152 prop = `-webkit-${prop}`;
153 }
154
155 style[prop] = val + (typeof val === 'string' ? '' : 'px');
156
157 }
158 }
159 function onDrop (e) {
160 const dragElement = document.getElementById(dragId)
161 const moveOffsetTop = dragElement.offsetTop + 70 // 当前拖拽离顶部的高度

Callers 1

onDropFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected