/** * @class Ext.ux.Toast * Passive popup box (a toast) singleton * @singleton */ Ext.ux.Toast = function() { var msgCt; function createBox(t, s){ return ['
', '
', '

', t, '

', s, '
', '
', '
'].join(''); } return { /** * Shows popup * @member Ext.ux.Toast * @param {String} title * @param {String} format */ msg : function(title, format){ if(!msgCt){ msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div',style:'position:absolute;z-index:10000'}, true); } var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1)); var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true); msgCt.alignTo(document, 't-t'); m.slideIn('t').pause(1.5).ghost("t", {remove:true}); } } }();