mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(domUtil): remove centerElementByMargin. Use flex containers.
This commit is contained in:
@@ -189,27 +189,6 @@
|
||||
dest.parentNode.insertBefore(src, dest);
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
centerElementByMargin: function(el) {
|
||||
el.style.marginLeft = (-el.offsetWidth) / 2 + 'px';
|
||||
el.style.marginTop = (-el.offsetHeight) / 2 + 'px';
|
||||
},
|
||||
//Center twice, after raf, to fix a bug with ios and showing elements
|
||||
//that have just been attached to the DOM.
|
||||
centerElementByMarginTwice: function(el) {
|
||||
ionic.requestAnimationFrame(function() {
|
||||
ionic.DomUtil.centerElementByMargin(el);
|
||||
setTimeout(function() {
|
||||
ionic.DomUtil.centerElementByMargin(el);
|
||||
setTimeout(function() {
|
||||
ionic.DomUtil.centerElementByMargin(el);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
elementIsDescendant: function(el, parent, stopAt) {
|
||||
var current = el;
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user