Skip to content

Commit e140746

Browse files
authored
Merge pull request #5506 from dejvo/upstream
Compatibility with jQuery 2.1.4 and above
2 parents 962358e + 631a3da commit e140746

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/services/DomUtilityService.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,24 @@
6464
};
6565
domUtilityService.getRealWidth = function (obj) {
6666
var width = 0;
67+
var name, old = {};
6768
var props = { visibility: "hidden", display: "block" };
6869
var hiddenParents = obj.parents().andSelf().not(':visible');
69-
$.swap(hiddenParents[0], props, function () {
70-
width = obj.outerWidth();
71-
});
70+
var elem = hiddenParents[0];
71+
72+
// Remember the old values, and insert the new ones
73+
for (name in props) {
74+
old[name] = elem.style[name];
75+
elem.style[name] = props[name];
76+
}
77+
78+
width = obj.outerWidth();
79+
80+
// Revert the old values
81+
for (name in props) {
82+
elem.style[name] = old[name];
83+
}
84+
7285
return width;
7386
};
7487
domUtilityService.UpdateGridLayout = function($scope, grid) {

0 commit comments

Comments
 (0)