// Adds a class to an element WebDeveloper.Common.addClass = function(element, className) { // If the element and class name are set and the element does not already have this class if(element && className && !WebDeveloper.Common.hasClass(element, className)) { // If the classes are on an SVG if(element.className instanceof SVGAnimatedString) { element.className.baseVal = (element.className.baseVal + " " + className).trim(); } else { element.className = (element.className + " " + className).trim(); } } };
// Adjusts the position of the given element WebDeveloper.Common.adjustElementPosition = function(element, xPosition, yPosition, offset) { // If the element is set if(element) { var contentWindow = WebDeveloper.Common.getContentWindow(); var innerHeight = contentWindow.
var WebDeveloper = WebDeveloper || {}; // eslint-disable-line no-use-before-define
ReplyDeleteWebDeveloper.Common = WebDeveloper.Common || {};
WebDeveloper.Common.requestTimeout = 10000;
// Adds a class to an element
WebDeveloper.Common.addClass = function(element, className)
{
// If the element and class name are set and the element does not already have this class
if(element && className && !WebDeveloper.Common.hasClass(element, className))
{
// If the classes are on an SVG
if(element.className instanceof SVGAnimatedString)
{
element.className.baseVal = (element.className.baseVal + " " + className).trim();
}
else
{
element.className = (element.className + " " + className).trim();
}
}
};
// Adjusts the position of the given element
WebDeveloper.Common.adjustElementPosition = function(element, xPosition, yPosition, offset)
{
// If the element is set
if(element)
{
var contentWindow = WebDeveloper.Common.getContentWindow();
var innerHeight = contentWindow.