assets/js/romo/base.js in romo-0.20.0 vs assets/js/romo/base.js in romo-0.20.1

- old
+ new

@@ -240,10 +240,18 @@ Romo.array(elems).forEach(function(elem) { elem.style.display = 'none'; }); } +Romo.prototype.height = function(elem) { + return elem.getBoundingClientRect().height; +} + +Romo.prototype.width = function(elem) { + return elem.getBoundingClientRect().width; +} + Romo.prototype.offset = function(elem) { var elemRect = elem.getBoundingClientRect(); var bodyRect = document.body.getBoundingClientRect(); return { top: elemRect.top - bodyRect.top, @@ -307,11 +315,11 @@ } // elems init Romo.prototype.elems = function(htmlString) { - var context = document.implementation.createHTMLDocument(); + var context = document.implementation.createHTMLDocument(''); // Set the base href for the created document so any parsed // elements with URLs are based on the document's URL var base = context.createElement('base'); base.href = document.location.href; @@ -1064,10 +1072,10 @@ RomoParentChildElems.prototype.doInit = function(parentElem, childElems) { var parentRemovedObserver = new MutationObserver(Romo.proxy(function(mutationRecords) { mutationRecords.forEach(Romo.proxy(function(mutationRecord) { if (mutationRecord.type === 'childList' && mutationRecord.removedNodes.length > 0) { - mutationRecord.removedNodes.forEach(Romo.proxy(function(removedNode) { + Romo.array(mutationRecord.removedNodes).forEach(Romo.proxy(function(removedNode) { this.remove(removedNode); }, this)); } }, this)); }, this));