/** * 状态条管理 */ Divo.app.StatusBar = function() { /* ----------------------- private变量 ----------------------- */ var bar, barMsg; /* ----------------------- private方法 ----------------------- */ // 渐进渐出效果 function slideIn(duration) { bar.slideIn('t').pause(duration).ghost("t", { remove : false }); } /* ----------------------- public方法 ----------------------- */ return { /** * 初始化 */ init : function() { bar = Ext.get('status-bar'); barMsg = Ext.get('status-msg'); Ext.get('status-bar-close').on('click', function() { Divo.clear(); }); bar.hide(); }, /** * 隐藏状态条 */ clear : function() { bar.hide(); }, /** * 状态条中显示等待信息 */ wait : function(msg) { bar.show(); barMsg.update(""+ msg); }, /** * 状态条中显示操作成功信息 */ success : function(msg) { barMsg.update('' + msg); slideIn(2); }, /** * 状态条中显示操作失败信息 */ error : function(msg) { barMsg.update('' + msg + ''); slideIn(5); } }; // return }(); Ext.onReady(Divo.app.StatusBar.init, Divo.app.StatusBar, true); // EOP