diff --git a/simpleui/__init__.py b/simpleui/__init__.py index d8741a92..f6d3c2e7 100644 --- a/simpleui/__init__.py +++ b/simpleui/__init__.py @@ -2,4 +2,4 @@ def get_version(): - return '4.0.2' + return '4.0.3' diff --git a/simpleui/static/admin/simpleui-x/js/index.js b/simpleui/static/admin/simpleui-x/js/index.js index bf4a6baa..581b34b5 100644 --- a/simpleui/static/admin/simpleui-x/js/index.js +++ b/simpleui/static/admin/simpleui-x/js/index.js @@ -374,15 +374,27 @@ window.open(url); }, contextmenu: function (item, e) { + //右键菜单,如果x+菜单宽度超过屏幕宽度,就默认为屏幕宽度-10-菜单宽度 //home没有popup menu if (item.id == '0') { return; } this.popup.tab = item; - this.popup.left = e.clientX; - this.popup.top = e.clientY; this.popup.show = true; + this.$nextTick(function () { + let el = this.$refs.popupmenu; + el.style.width='150px'; + let x = e.clientX; + + let w= document.body.offsetWidth + if(x+150>w){ + x = w - 160; + } + + this.popup.left = x; + this.popup.top = e.clientY; + }); }, mainClick: function (e) { this.popup.show = false; @@ -572,7 +584,7 @@ }, report: function (url) { if (!url) { - if ($("html").lang) { + if (document.querySelector('html').lang) { url = 'https://simpleui.88cto.com'; } else { url = 'https://github.com/newpanjing/simpleui/issues'; diff --git a/simpleui/templates/admin/base.html b/simpleui/templates/admin/base.html index c6f8e210..6cfea7b1 100644 --- a/simpleui/templates/admin/base.html +++ b/simpleui/templates/admin/base.html @@ -1,34 +1,19 @@ -{% load i18n static simpletags %} +{% load i18n static simpletags %} {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}