Files
ionic-framework/js/views/popupView.js
2013-10-21 16:57:18 -05:00

39 lines
864 B
JavaScript

(function(ionic) {
'use strict';
/**
* An ActionSheet is the slide up menu popularized on iOS.
*
* You see it all over iOS apps, where it offers a set of options
* triggered after an action.
*/
ionic.views.Popup = function(opts) {
var _this = this;
this.el = opts.el;
};
ionic.views.Popup.prototype = {
setTitle: function(title) {
var titleEl = el.querySelector('.popup-title');
if(titleEl) {
titleEl.innerHTML = title;
}
},
alert: function(message) {
var _this = this;
window.requestAnimationFrame(function() {
_this.setTitle(message);
_this.el.classList.add('active');
});
},
hide: function() {
// Force a reflow so the animation will actually run
this.el.offsetWidth;
this.el.classList.remove('active');
}
};
})(ionic);