Przeglądaj źródła

解决用户管理页面滚动返回顶部条失效

Ricky 4 lat temu
rodzic
commit
7d8b7ba2d5

+ 2 - 2
ruoyi-admin/src/main/resources/static/ruoyi/js/common.js

@@ -191,8 +191,8 @@ $(function() {
     'use strict';
     $.fn.toTop = function(opt) {
         var elem = this;
-        var win = $(window);
-        var doc = $('html, body');
+        var win = (opt && opt.hasOwnProperty('win')) ? opt.win : $(window);
+        var doc = (opt && opt.hasOwnProperty('doc')) ? opt.doc : $('html, body');
         var options = $.extend({
             autohide: true,
             offset: 50,

+ 8 - 0
ruoyi-admin/src/main/resources/templates/system/user/user.html

@@ -101,6 +101,14 @@
 		        panehHidden = true;
 		    }
 		    $('body').layout({ initClosed: panehHidden, west__size: 185 });
+	     	// 回到顶部绑定
+	    	if ($.fn.toTop !== undefined) {
+	    		var opt = {
+	    			win:$('.ui-layout-center'),
+	    			doc:$('.ui-layout-center')
+	    		};
+	    		$('#scroll-up').toTop(opt);
+	    	}
 		    queryUserList();
 		    queryDeptTree();
 		});