MCPcopy
hub / github.com/retspen/webvirtcloud / resizeEvent

Function resizeEvent

static/js/ext-textarea.js:245–258  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243 var parentNode = element.parentNode;
244 var container = document.createElement('div');
245 var resizeEvent = function() {
246 var style = 'position:relative;';
247 [
248 'margin-top', 'margin-left', 'margin-right', 'margin-bottom'
249 ].forEach(function(item) {
250 style += item + ':' +
251 getCSSProperty(element, container, item) + ';';
252 });
253 var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px");
254 var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px");
255 style += 'height:' + height + ';width:' + width + ';';
256 style += 'display:inline-block;';
257 container.setAttribute('style', style);
258 };
259 event.addListener(window, 'resize', resizeEvent);
260 resizeEvent();
261 parentNode.insertBefore(container, element.nextSibling);

Callers 1

setupContainerFunction · 0.85

Calls 1

getCSSPropertyFunction · 0.85

Tested by

no test coverage detected