Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dragData.delta = PROPERTY_DELTA[this.property];
dragData.factor = this.factor;
// determine dir
var cssFloat = computedStyle(this.element, 'float');
var cssPosition = computedStyle(this.element, 'position');
var relToOffsetParent = cssPosition == 'absolute' || cssPosition == 'fixed';
var parentNode = relToOffsetParent ? this.element.offsetParent || document.body : this.element.parentNode;
var parentNodeSize;
if (dragData.delta == 'deltaY')
{
dragData.offsetStart = this.element.clientHeight
- parseFloat(computedStyle(this.element, 'padding-top'))
- parseFloat(computedStyle(this.element, 'padding-bottom'));
parentNodeSize = parentNode.clientHeight;
if (!relToOffsetParent)
parentNodeSize -= parseFloat(computedStyle(parentNode, 'padding-top')) + parseFloat(computedStyle(parentNode, 'padding-bottom'));
if (isNaN(dragData.factor))
dragData.factor = -(relToOffsetParent && computedStyle(this.element, 'bottom') != 'auto') || 1;
}
else
{
dragData.offsetStart = this.element.clientWidth
- parseFloat(computedStyle(this.element, 'padding-left'))
- parseFloat(computedStyle(this.element, 'padding-right'));
parentNodeSize = parentNode.clientWidth;
if (!relToOffsetParent)
emit_start: function(dragData, event){
super_.emit_start.call(this, dragData, event);
cursorOverrideRule.setProperty('cursor', this.cursor + ' !important');
dragData.delta = PROPERTY_DELTA[this.property];
dragData.factor = this.factor;
// determine dir
var cssFloat = computedStyle(this.element, 'float');
var cssPosition = computedStyle(this.element, 'position');
var relToOffsetParent = cssPosition == 'absolute' || cssPosition == 'fixed';
var parentNode = relToOffsetParent ? this.element.offsetParent || document.body : this.element.parentNode;
var parentNodeSize;
if (dragData.delta == 'deltaY')
{
dragData.offsetStart = this.element.clientHeight
- parseFloat(computedStyle(this.element, 'padding-top'))
- parseFloat(computedStyle(this.element, 'padding-bottom'));
parentNodeSize = parentNode.clientHeight;
if (!relToOffsetParent)
parentNodeSize -= parseFloat(computedStyle(parentNode, 'padding-top')) + parseFloat(computedStyle(parentNode, 'padding-bottom'));
if (isNaN(dragData.factor))
function isVisible(element){
if (getComputedStyle(element, 'visibility') != 'visible')
return false;
var box = getBoundingRect(element);
if (!box.width || !box.height)
return false;
return true;
}
var cssFloat = computedStyle(this.element, 'float');
var cssPosition = computedStyle(this.element, 'position');
var relToOffsetParent = cssPosition == 'absolute' || cssPosition == 'fixed';
var parentNode = relToOffsetParent ? this.element.offsetParent || document.body : this.element.parentNode;
var parentNodeSize;
if (dragData.delta == 'deltaY')
{
dragData.offsetStart = this.element.clientHeight
- parseFloat(computedStyle(this.element, 'padding-top'))
- parseFloat(computedStyle(this.element, 'padding-bottom'));
parentNodeSize = parentNode.clientHeight;
if (!relToOffsetParent)
parentNodeSize -= parseFloat(computedStyle(parentNode, 'padding-top')) + parseFloat(computedStyle(parentNode, 'padding-bottom'));
if (isNaN(dragData.factor))
dragData.factor = -(relToOffsetParent && computedStyle(this.element, 'bottom') != 'auto') || 1;
}
else
{
dragData.offsetStart = this.element.clientWidth
- parseFloat(computedStyle(this.element, 'padding-left'))
- parseFloat(computedStyle(this.element, 'padding-right'));
parentNodeSize = parentNode.clientWidth;
if (!relToOffsetParent)
parentNodeSize -= parseFloat(computedStyle(parentNode, 'padding-left')) + parseFloat(computedStyle(parentNode, 'padding-right'));
if (isNaN(dragData.factor))
{
function getHeight(element){
return element.clientHeight
- parseInt(computedStyle(element, 'padding-top'))
- parseInt(computedStyle(element, 'padding-bottom'));
}
processNode: function(domNode, context){
if (domNode.nodeType == 3)
this.highlight(domNode, {
gridOffset: context.offset,
gridSize: context.size,
baseline: getBaseline(domNode)
});
if (domNode.nodeType == 1 && domNode.tagName == 'INPUT' && domNode.type != 'file')
this.highlight(domNode, {
gridOffset: context.offset,
gridSize: context.size,
baseline: getBaseline(domNode)
+ parseInt(getComputedStyle(domNode, 'padding-bottom'))
//+ parseInt(getComputedStyle(domNode, 'border-bottom-width'))
});
}
});
- parseFloat(computedStyle(this.element, 'padding-left'))
- parseFloat(computedStyle(this.element, 'padding-right'));
parentNodeSize = parentNode.clientWidth;
if (!relToOffsetParent)
parentNodeSize -= parseFloat(computedStyle(parentNode, 'padding-left')) + parseFloat(computedStyle(parentNode, 'padding-right'));
if (isNaN(dragData.factor))
{
if (cssFloat == 'right')
dragData.factor = -1;
else
if (cssFloat == 'left')
dragData.factor = 1;
else
dragData.factor = -(relToOffsetParent && computedStyle(this.element, 'right') != 'auto') || 1;
}
}
dragData.offsetStartInPercent = 100 / parentNodeSize;
classList(this.resizer).add('selected');
},
emit_drag: function(dragData, event){
var init = function(){
if (getComputedStyle(element, 'position') == 'static')
element.style.position = 'relative';
var document = sensor.contentDocument;
var win = document.defaultView || document.parentWindow;
win.onresize = handler;
win.document.body.onresize = handler;
handler();
};
dragData.offsetStart = this.element.clientHeight
- parseFloat(computedStyle(this.element, 'padding-top'))
- parseFloat(computedStyle(this.element, 'padding-bottom'));
parentNodeSize = parentNode.clientHeight;
if (!relToOffsetParent)
parentNodeSize -= parseFloat(computedStyle(parentNode, 'padding-top')) + parseFloat(computedStyle(parentNode, 'padding-bottom'));
if (isNaN(dragData.factor))
dragData.factor = -(relToOffsetParent && computedStyle(this.element, 'bottom') != 'auto') || 1;
}
else
{
dragData.offsetStart = this.element.clientWidth
- parseFloat(computedStyle(this.element, 'padding-left'))
- parseFloat(computedStyle(this.element, 'padding-right'));
parentNodeSize = parentNode.clientWidth;
if (!relToOffsetParent)
parentNodeSize -= parseFloat(computedStyle(parentNode, 'padding-left')) + parseFloat(computedStyle(parentNode, 'padding-right'));
if (isNaN(dragData.factor))
{
if (cssFloat == 'right')
dragData.factor = -1;
else
if (cssFloat == 'left')
dragData.factor = 1;
else
dragData.factor = -(relToOffsetParent && computedStyle(this.element, 'right') != 'auto') || 1;
}
}
read: function(element){
return parseFloat(getComputedStyle(element, this.property));
},
write: function(element, formattedValue){