details: https://code.openbravo.com/erp/devel/pi/rev/b6c381dc939e
changeset: 13363:b6c381dc939e
user: Martin Taal <martin.taal <at> openbravo.com>
date: Mon Aug 01 16:04:40 2011 +0200
summary: Related to 18072: Focus handling in form and grid editing needs to
be cleaned up, results in unpredictable behavior
Also removed not-needed code, prevent too many focus actions from taking place
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
| 4 -
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
| 42 ++-------
2 files changed, 10 insertions(+), 36 deletions(-)
diffs (80 lines):
diff -r c087bb4d81c2 -r b6c381dc939e
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
Mon Aug 01 15:51:20 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
Mon Aug 01 16:04:40 2011 +0200
@@ -198,10 +198,6 @@
}
},
- doSelectElement: function() {
- this.Super('doSelectElement', [this.dateTextField]);
- },
-
// update the value in update value as this is called from cellEditEnd in the
// grid
updateValue: function() {
diff -r c087bb4d81c2 -r b6c381dc939e
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
---
a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
Mon Aug 01 15:51:20 2011 +0200
+++
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
Mon Aug 01 16:04:40 2011 +0200
@@ -89,17 +89,6 @@
}
return this._original_compareValues(value1, value2);
},
-
- // overridden because when a formitem has showDisabled false
- // then still its icons are shown disabled
- _getIconURL: isc.FormItem.getPrototype().getIconURL,
- getIconURL: function (icon, over, disabled, focused) {
- if (disabled && !this.showDisabled) {
- return this._getIconURL(icon, over, false, focused);
- } else {
- return this._getIconURL(icon, over, disabled, focused);
- }
- },
_handleTitleClick: isc.FormItem.getPrototype().handleTitleClick,
handleTitleClick: function() {
@@ -113,6 +102,16 @@
return this._handleTitleClick();
},
+ // prevent to many calls to focus in item if there is already focus
+ _focusInItem: isc.FormItem.getPrototype().focusInItem,
+ focusInItem: function() {
+ if (this.hasFocus) {
+ this.selectValue();
+ return;
+ }
+ this._focusInItem();
+ },
+
titleClick: function(form, item){
item.focusInItem();
if (item.linkButtonClick) {
@@ -144,27 +143,6 @@
}
this.hasFocus = true;
},
-
- doSelectElement: function(item, delayed) {
- var me = this;
-
- if (!delayed && isc.Browser.isIE) {
- this.fireOnPause("doSelectElement", function() {
- me.doSelectElement(item, true);
- }, 0, this);
- return;
- }
-
- item = item || this;
- if (isc.isA.OBTextAreaItem(item)) {
- // don't do anything here
- } else if (item.getElement() && item.getElement().select) {
- item.getElement().select();
- } else {
- // nothing else, just do the native stuff
- this.selectValue();
- }
- },
blur: function(form, item){
if (item._hasChanged && form && form.handleItemChange) {
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits