Some loading box tweaks

This commit is contained in:
Max Lynch
2013-10-21 16:57:18 -05:00
parent ce5d3e6fde
commit bc6819d5a0
12 changed files with 849 additions and 634 deletions

25
dist/js/ionic.js vendored
View File

@ -2336,6 +2336,9 @@ window.ionic = {
var _this = this;
this.el = opts.el;
this.maxWidth = opts.maxWidth || 200;
this._loadingBox = this.el.querySelector('.loading');
};
@ -2344,12 +2347,18 @@ window.ionic = {
var _this = this;
if(this._loadingBox) {
window.requestAnimationFrame(function() {
_this.el.classList.add('active');
//window.requestAnimationFrame(function() {
var lb = _this._loadingBox;
_this._loadingBox.style.marginLeft = (-_this._loadingBox.offsetWidth) / 2 + 'px';
_this._loadingBox.style.marginTop = (-_this._loadingBox.offsetHeight) / 2 + 'px';
});
var width = Math.min(_this.maxWidth, Math.max(window.outerWidth - 40, lb.offsetWidth));
lb.style.width = width;
lb.style.marginLeft = (-lb.offsetWidth) / 2 + 'px';
lb.style.marginTop = (-lb.offsetHeight) / 2 + 'px';
_this.el.classList.add('active');
//});
}
},
hide: function() {
@ -2450,8 +2459,10 @@ window.ionic = {
ionic.views.Popup.prototype = {
setTitle: function(title) {
var title = el.querySelector('.popup-title');
title && title.innerHTML = title;
var titleEl = el.querySelector('.popup-title');
if(titleEl) {
titleEl.innerHTML = title;
}
},
alert: function(message) {
var _this = this;