Authored by xuqi

loading modify

@@ -10,17 +10,14 @@ var $page = $('.yoho-page'); @@ -10,17 +10,14 @@ var $page = $('.yoho-page');
10 10
11 var $loading; 11 var $loading;
12 12
13 -/**  
14 - * 初始化loading mask  
15 - * @param $container loading容器, position:relative  
16 - */  
17 -function initLoadingMask() { 13 +//初始化
  14 +(function() {
18 var html = '<div class="loading-mask hide"><div class="loading"></div></div>'; 15 var html = '<div class="loading-mask hide"><div class="loading"></div></div>';
19 16
20 $page.append(html); 17 $page.append(html);
21 18
22 $loading = $page.children('.loading-mask'); 19 $loading = $page.children('.loading-mask');
23 -} 20 +}());
24 21
25 //显示loading 22 //显示loading
26 function showLoadingMask() { 23 function showLoadingMask() {
@@ -32,6 +29,5 @@ function hideLoadingMask() { @@ -32,6 +29,5 @@ function hideLoadingMask() {
32 $loading.addClass('hide'); 29 $loading.addClass('hide');
33 } 30 }
34 31
35 -exports.initLoadingMask = initLoadingMask;  
36 exports.showLoadingMask = showLoadingMask; 32 exports.showLoadingMask = showLoadingMask;
37 exports.hideLoadingMask = hideLoadingMask; 33 exports.hideLoadingMask = hideLoadingMask;
@@ -209,7 +209,6 @@ function search(opt) { @@ -209,7 +209,6 @@ function search(opt) {
209 lazyLoad($('.lazy')); 209 lazyLoad($('.lazy'));
210 210
211 filter.registerCbFn(search); 211 filter.registerCbFn(search);
212 -loading.initLoadingMask();  
213 212
214 //导航栏点击逻辑说明: 213 //导航栏点击逻辑说明:
215 //1.点击非active项时切换active状态 214 //1.点击非active项时切换active状态