From 094fd0ec23e34d17d598e8c6df0996f6c619bae2 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 25 May 2015 15:20:26 +0530 Subject: [PATCH 1/2] [fixes] autocomplete overlap and minor enhancements to tree --- frappe/public/css/desk.css | 6 ------ frappe/public/js/frappe/form/control.js | 2 ++ frappe/public/js/frappe/ui/tree.js | 11 +++++++++-- frappe/public/less/desk.less | 6 ++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index 2e14faf655..da3eea4f48 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -362,12 +362,6 @@ ul.linked-with-list li { font-size: 12px; } /* z-index hack */ -.ui-datepicker { - z-index: 9999999 !important; -} -.ui-autocomplete { - z-index: 9999999 !important; -} @media (min-width: 768px) { .hidden-xs-inline { display: inline; diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index dcea86eece..8701e59f33 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -1052,9 +1052,11 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ }); }, open: function(event, ui) { + me.$wrapper.css({"z-index": 101}); me.autocomplete_open = true; }, close: function(event, ui) { + me.$wrapper.css({"z-index": 1}); me.autocomplete_open = false; }, focus: function( event, ui ) { diff --git a/frappe/public/js/frappe/ui/tree.js b/frappe/public/js/frappe/ui/tree.js index c07e691d3c..7249807419 100644 --- a/frappe/public/js/frappe/ui/tree.js +++ b/frappe/public/js/frappe/ui/tree.js @@ -18,6 +18,7 @@ frappe.ui.Tree = Class.extend({ root: true, data: { value: this.label, + parent: this.label, expandable: true } }); @@ -81,13 +82,19 @@ frappe.ui.TreeNode = Class.extend({ if(this.expandable) { icon_html = ''; } - $(icon_html + ' ' + __(this.label) + ""). + $(icon_html + ' ' + this.get_label() + ""). appendTo(this.$a); this.$a.find('i').click(function() { setTimeout(function() { me.toolbar.find(".btn-expand").click(); }, 100); }); }, + get_label: function() { + if(this.tree.get_label) { + return this.tree.get_label(this); + } + return __(this.label); + }, toggle: function(callback) { if(this.expandable && this.tree.method && !this.loaded) { this.load(callback) @@ -194,7 +201,7 @@ frappe.ui.TreeNode = Class.extend({ load: function(callback) { var me = this; args = $.extend(this.tree.args || {}, { - parent: this.data ? this.data.value : null + parent: this.data ? (this.data.parent || this.data.value) : null }); return frappe.call({ diff --git a/frappe/public/less/desk.less b/frappe/public/less/desk.less index 22d681851d..ab2d93dcdf 100644 --- a/frappe/public/less/desk.less +++ b/frappe/public/less/desk.less @@ -180,10 +180,8 @@ ul.linked-with-list li { } /* z-index hack */ -.ui-datepicker { z-index: 9999999 !important; } -.ui-autocomplete { - z-index: 9999999 !important; -} +// .ui-datepicker { z-index: 9999999 !important; } +// .ui-autocomplete { z-index: 9999999 !important; } @media (min-width: 768px) { .hidden-xs-inline { From 267fbb018ee20725ace876b8bd32af29345968e9 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Mon, 25 May 2015 17:00:54 +0600 Subject: [PATCH 2/2] bumped to version 5.0.9 --- frappe/__version__.py | 2 +- frappe/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/__version__.py b/frappe/__version__.py index 44be8a7bec..661ac4e319 100644 --- a/frappe/__version__.py +++ b/frappe/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = "5.0.8" +__version__ = "5.0.9" diff --git a/frappe/hooks.py b/frappe/hooks.py index 65f922932b..b0177cb1ce 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -4,7 +4,7 @@ app_title = "Frappe Framework" app_publisher = "Frappe Technologies Pvt. Ltd." app_description = "Full Stack Web Application Framework in Python" app_icon = "octicon octicon-circuit-board" -app_version = "5.0.8" +app_version = "5.0.9" app_color = "orange" app_email = "support@frappe.io" diff --git a/setup.py b/setup.py index 53b3d08ebe..277ee2ae2a 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.0.8" +version = "5.0.9" with open("requirements.txt", "r") as f: install_requires = f.readlines()