// ================================Loading===================================// Loading = $.fm.LoadingClass = Control.subClass({ template: [ '
' ], itemTemplate: '', itemList: {}, init: function(options) { options = options ? options : {}; Control.call(this, options); this.canvas = $(window.top.window.document.body); this.createEl(); }, createEl: function() { var el = this.el = $(this.template.join("")); this.area = $("#area", el); this.canvas.append(this.el); }, show: function (code, text) { text = text || code; code = code || "item"; var item = this.itemList[code]; if (!item) { item = this.itemList[code] = $(this.itemTemplate); this.area.append(item); } item.html(text); this.el.show(); }, hide: function(code) { if (code) { var item = this.itemList[code]; if (item) { item.remove(); } for (var n in this.itemList) { return; } this.el.hide(); return; } this.el.hide(); for (var n in this.itemList) { var item = this.itemList[n]; if (item.remove) { item.remove(); } } this.itemList = {}; } }); Loading.show = function(code, text) { var instance = window.top.window.Loading.instance || this.instance; if (!instance) { instance = this.instance = new $.fm.LoadingClass(); } instance.show(code, text); }; Loading.hide = function(code) { var instance = window.top.window.Loading.instance || this.instance; if (!instance) { instance = this.instance = new $.fm.LoadingClass(); } instance.hide(code); }; $(window.document).ready(function() { Loading.hide(); });