cytoscape-compound-resize
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -85,6 +85,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.cytoscapeCompoundResize = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
nodes.each(function (i, ele) { | ||
var paddingLeft = parseInt(ele.css('padding-left')); | ||
var paddingRight = parseInt(ele.css('padding-right')); | ||
var paddingTop = parseInt(ele.css('padding-top')); | ||
var paddingBottom = parseInt(ele.css('padding-bottom')); | ||
var paddingLeft = parseFloat(ele.css('padding-left')); | ||
var paddingRight = parseFloat(ele.css('padding-right')); | ||
var paddingTop = parseFloat(ele.css('padding-top')); | ||
var paddingBottom = parseFloat(ele.css('padding-bottom')); | ||
@@ -126,3 +126,3 @@ var minPaddings = self.getMinimumPaddings(ele); | ||
extremePaddings.left = parseInt(paddings.left); | ||
extremePaddings.left = parseFloat(paddings.left); | ||
} | ||
@@ -136,3 +136,3 @@ | ||
extremePaddings.right = parseInt(paddings.right); | ||
extremePaddings.right = parseFloat(paddings.right); | ||
} | ||
@@ -146,3 +146,3 @@ | ||
extremePaddings.top = parseInt(paddings.top); | ||
extremePaddings.top = parseFloat(paddings.top); | ||
} | ||
@@ -156,3 +156,3 @@ | ||
extremePaddings.bottom = parseInt(paddings.bottom); | ||
extremePaddings.bottom = parseFloat(paddings.bottom); | ||
} | ||
@@ -320,3 +320,3 @@ }); | ||
if (topDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-top')); | ||
var currentPadding = parseFloat(ancestor.css('padding-top')); | ||
paddingTop = currentPadding + topDiff; | ||
@@ -328,3 +328,3 @@ } | ||
if (bottomDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-bottom')); | ||
var currentPadding = parseFloat(ancestor.css('padding-bottom')); | ||
paddingBottom = currentPadding - bottomDiff; | ||
@@ -336,3 +336,3 @@ } | ||
if (leftDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-left')); | ||
var currentPadding = parseFloat(ancestor.css('padding-left')); | ||
paddingLeft = currentPadding + leftDiff; | ||
@@ -344,3 +344,3 @@ } | ||
if (rightDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-right')); | ||
var currentPadding = parseFloat(ancestor.css('padding-right')); | ||
paddingRight = currentPadding - rightDiff; | ||
@@ -475,2 +475,2 @@ } | ||
}); | ||
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvY29tcG91bmRSZXNpemVVdGlsaXRpZXMuanMiLCJzcmMvZWxlbWVudFV0aWxpdGllcy5qcyIsInNyYy9pbmRleC5qcyIsInNyYy9zY3JhdGNoVXRpbGl0aWVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FDQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ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WxlbWVudFV0aWxpdGllcy5nZXRDb3JuZXJQb3NpdGlvbnMoYW5jZXN0b3IpO1xuXG4gICAgICAgICAgICBpZiAoY3VycmVudENvcm5lcnMudG9wID09PSBvbGRDb3JuZXJzLnRvcCAmJiBjdXJyZW50Q29ybmVycy5ib3R0b20gPT09IG9sZENvcm5lcnMuYm90dG9tXG4gICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRDb3JuZXJzLmxlZnQgPT09IG9sZENvcm5lcnMubGVmdCAmJiBjdXJyZW50Q29ybmVycy5yaWdodCA9PT0gb2xkQ29ybmVycy5yaWdodCkge1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHBhZGRpbmdUb3AsIHBhZGRpbmdCb3R0b20sIHBhZGRpbmdMZWZ0LCBwYWRkaW5nUmlnaHQ7XG5cbiAgICAgICAgICAgIHZhciB0b3BEaWZmID0gY3VycmVudENvcm5lcnMudG9wIC0gb2xkQ29ybmVycy50b3A7XG5cbiAgICAgICAgICAgIGlmICh0b3BEaWZmICE9IDApIHtcbiAgICAgICAgICAgICAgdmFyIGN1cnJlbnRQYWRkaW5nID0gcGFyc2VJbnQoYW5jZXN0b3IuY3NzKCdwYWRkaW5nLXRvcCcpKTtcbiAgICAgICAgICAgICAgcGFkZGluZ1RvcCA9IGN1cnJlbnRQYWRkaW5nICsgdG9wRGlmZjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGJvdHRvbURpZmYgPSBjdXJyZW50Q29ybmVycy5ib3R0b20gLSBvbGRDb3JuZXJzLmJvdHRvbTtcblxuICAgICAgICAgICAgaWYgKGJvdHRvbURpZmYgIT0gMCkge1xuICAgICAgICAgICAgICB2YXIgY3VycmVudFBhZGRpbmcgPSBwYXJzZUludChhbmNlc3Rvci5jc3MoJ3BhZGRpbmctYm90dG9tJykpO1xuICAgICAgICAgICAgICBwYWRkaW5nQm90dG9tID0gY3VycmVudFBhZGRpbmcgLSBib3R0b21EaWZmO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgbGVmdERpZmYgPSBjdXJyZW50Q29ybmVycy5sZWZ0IC0gb2xkQ29ybmVycy5sZWZ0O1xuXG4gICAgICAgICAgICBpZiAobGVmdERpZmYgIT0gMCkge1xuICAgICAgICAgICAgICB2YXIgY3VycmVudFBhZGRpbmcgPSBwYXJzZUludChhbmNlc3Rvci5jc3MoJ3BhZGRpbmctbGVmdCcpKTtcbiAgICAgICAgICAgICAgcGFkZGluZ0xlZnQgPSBjdXJyZW50UGFkZGluZyArIGxlZnREaWZmO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgcmlnaHREaWZmID0gY3VycmVudENvcm5lcnMucmlnaHQgLSBvbGRDb3JuZXJzLnJpZ2h0O1xuXG4gICAgICAgICAgICBpZiAocmlnaHREaWZmICE9IDApIHtcbiAgICAgICAgICAgICAgdmFyIGN1cnJlbnRQYWRkaW5nID0gcGFyc2VJbnQoYW5jZXN0b3IuY3NzKCdwYWRkaW5nLXJpZ2h0JykpO1xuICAgICAgICAgICAgICBwYWRkaW5nUmlnaHQgPSBjdXJyZW50UGFkZGluZyAtIHJpZ2h0RGlmZjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFwYWRkaW5nVG9wICYmICFwYWRkaW5nQm90dG9tICYmICFwYWRkaW5nTGVmdCAmJiAhcGFkZGluZ1JpZ2h0KSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgcGFkZGluZ3MgPSB7fTtcblxuICAgICAgICAgICAgaWYgKHBhZGRpbmdUb3ApIHtcbiAgICAgICAgICAgICAgcGFkZGluZ3MudG9wID0gcGFkZGluZ1RvcDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBhZGRpbmdCb3R0b20pIHtcbiAgICAgICAgICAgICAgcGFkZGluZ3MuYm90dG9tID0gcGFkZGluZ0JvdHRvbTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBhZGRpbmdMZWZ0KSB7XG4gICAgICAgICAgICAgIHBhZGRpbmdzLmxlZnQgPSBwYWRkaW5nTGVmdDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBhZGRpbmdSaWdodCkge1xuICAgICAgICAgICAgICBwYWRkaW5ncy5yaWdodCA9IHBhZGRpbmdSaWdodDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29tcG91bmRSZXNpemVVdGlsaXRpZXMuc2V0UGFkZGluZ3MoYW5jZXN0b3IsIHBhZGRpbmdzKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfTtcblxuICAgICAgY3kub24oJ3RhcHN0YXJ0JywgJ25vZGUnLCB0YXBTdGFydEZjbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYoIG1vZGUgIT09ICdtaW4nICkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgdmFyIG5vZGUgPSB0aGlzO1xuXG4gICAgICAgIGlmIChub2RlLnNlbGVjdGVkKCkpIHtcbiAgICAgICAgICBlZmZlY3RlZE5vZGVzID0gY3kuY29sbGVjdGlvbigpLmFkZChub2RlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBlZmZlY3RlZE5vZGVzID0gY3kubm9kZXMoJzpzZWxlY3RlZCcpLmRpZmZlcmVuY2Uobm9kZS5hbmNlc3RvcnMoKSkudW5pb24obm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBXZSBjYXJlIGFib3V0IHRoZSBtb3ZlbWVudCBvZiB0b3AgbW9zdCBub2Rlc1xuICAgICAgICBlZmZlY3RlZE5vZGVzID0gZWxlbWVudFV0aWxpdGllcy5nZXRUb3BNb3N0Tm9kZXMoZWZmZWN0ZWROb2Rlcyk7XG5cbiAgICAg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5nTGVmdDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBhZGRpbmdSaWdodCkge1xuICAgICAgICAgICAgICBwYWRkaW5ncy5yaWdodCA9IHBhZGRpbmdSaWdodDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29tcG91bmRSZXNpemVVdGlsaXRpZXMuc2V0UGFkZGluZ3MoYW5jZXN0b3IsIHBhZGRpbmdzKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfTtcblxuICAgICAgY3kub24oJ3RhcHN0YXJ0JywgJ25vZGUnLCB0YXBTdGFydEZjbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYoIG1vZGUgIT09ICdtaW4nICkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgdmFyIG5vZGUgPSB0aGlzO1xuXG4gICAgICAgIGlmIChub2RlLnNlbGVjdGVkKCkpIHtcbiAgICAgICAgICBlZmZlY3RlZE5vZGVzID0gY3kuY29sbGVjdGlvbigpLmFkZChub2RlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBlZmZlY3RlZE5vZGVzID0gY3kubm9kZXMoJzpzZWxlY3RlZCcpLmRpZmZlcmVuY2Uobm9kZS5hbmNlc3RvcnMoKSkudW5pb24obm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBXZSBjYXJlIGFib3V0IHRoZSBtb3ZlbWVudCBvZiB0b3AgbW9zdCBub2Rlc1xuICAgICAgICBlZmZlY3RlZE5vZGVzID0gZWxlbWVudFV0aWxpdGllcy5nZXRUb3BNb3N0Tm9kZXMoZWZmZWN0ZWROb2Rlcyk7XG5cbiAgICAgICAgZmlsbEVmZmVjdGVkRGF0YSh0cnVlKTtcbiAgICAgIH0pO1xuXG4gICAgICBjeS5vbignZHJhZycsICdub2RlJywgZHJhZ0ZjbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgIC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eU9yRWxlLnNjcmF0Y2goJ19jb21wb3VuZFJlc2l6ZScsIHt9KTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBjeU9yRWxlLnNjcmF0Y2goJ19jb21wb3VuZFJlc2l6ZScpO1xuICAgIH1cbiAgfTtcbn07XG5cbm1vZHVsZS5leHBvcnRzID0gc2NyYXRjaFV0aWxpdGllczsiXX0= |
{ | ||
"name": "cytoscape-compound-resize", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "A Cytoscape.js extension to resize compound nodes through setting their paddings", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-compound-resize.js", |
@@ -89,3 +89,3 @@ ; | ||
if (topDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-top')); | ||
var currentPadding = parseFloat(ancestor.css('padding-top')); | ||
paddingTop = currentPadding + topDiff; | ||
@@ -97,3 +97,3 @@ } | ||
if (bottomDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-bottom')); | ||
var currentPadding = parseFloat(ancestor.css('padding-bottom')); | ||
paddingBottom = currentPadding - bottomDiff; | ||
@@ -105,3 +105,3 @@ } | ||
if (leftDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-left')); | ||
var currentPadding = parseFloat(ancestor.css('padding-left')); | ||
paddingLeft = currentPadding + leftDiff; | ||
@@ -113,3 +113,3 @@ } | ||
if (rightDiff != 0) { | ||
var currentPadding = parseInt(ancestor.css('padding-right')); | ||
var currentPadding = parseFloat(ancestor.css('padding-right')); | ||
paddingRight = currentPadding - rightDiff; | ||
@@ -116,0 +116,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127330