-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathele.js
44 lines (34 loc) · 914 Bytes
/
ele.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Marcel Timm, RhinoDevel, 2020nov30
/** To be run during page load to augment single global obj. with new property.
*/
(function() // IIFE
{
'use strict';
// Requirements:
//
var num = rhino6502doc.num,
f = {};
f.createAndAppend = function(tagName, parentNode, flexOrder, flexDir)
{
var retVal = document.createElement(tagName);
if(num.isInt(flexOrder))
{
retVal.style.order = String(flexOrder);
}
if(typeof flexDir === 'string')
{
retVal.style.display = 'flex';
retVal.style['flex-direction'] = flexDir;
}
parentNode.appendChild(retVal);
return retVal;
};
f.clearContent = function(node)
{
while(node.firstChild !== null)
{
node.removeChild(node.firstChild);
}
};
rhino6502doc.ele = f;
}());