details:   https://code.openbravo.com/erp/devel/pi/rev/01f6a13554f4
changeset: 13181:01f6a13554f4
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Jul 18 14:40:18 2011 +0200
summary:   Related to issue 17600: When editing date-field in grid, trying to 
mark only month of it with the mouse does not work
When a user now clicks in a date field the value gets selected, again clicking 
now makes it possible to select the month
a form item was focused multiple times, removed focus when clicking, this is 
already done by Smartclient

details:   https://code.openbravo.com/erp/devel/pi/rev/0455b6961eaf
changeset: 13182:0455b6961eaf
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Jul 18 14:41:01 2011 +0200
summary:   Disable resetting selection if number item contains a number without 
grouping symbols (only reselect/set cursor if display value really changes)

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
 |   7 ++-
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
     |  18 +--------
 2 files changed, 7 insertions(+), 18 deletions(-)

diffs (59 lines):

diff -r 9daad2b86943 -r 0455b6961eaf 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
      Mon Jul 18 14:38:22 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
      Mon Jul 18 14:41:01 2011 +0200
@@ -100,8 +100,11 @@
     
     // get the edit value, without grouping symbol.
     var editValue = 
OB.Utilities.Number.OBMaskedToOBPlain(this.getElementValue(), 
this.getDecSeparator(), this.getGroupSeparator());
-    this.setElementValue(editValue);
-    this.setSelectionRange(newCaretPosition, newCaretPosition);
+    
+    if (oldCaretPosition !== newCaretPosition || editValue !== 
this.getElementValue()) {
+      this.setElementValue(editValue);
+      this.setSelectionRange(newCaretPosition, newCaretPosition);
+    }
   },
   
   replaceAt: function(string, what, ini, end){
diff -r 9daad2b86943 -r 0455b6961eaf 
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 Jul 18 14:38:22 2011 +0200
+++ 
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
  Mon Jul 18 14:41:01 2011 +0200
@@ -89,9 +89,8 @@
     }
     return this._original_compareValues(value1, value2);
   },
-
+ 
   _handleTitleClick: isc.FormItem.getPrototype().handleTitleClick,
-  
   handleTitleClick: function() {
     // always titleclick directly as sc won't call titleclick
     // in that case
@@ -120,26 +119,13 @@
     if (view) {
       view.lastFocusedItem = this;
     }
-  },
-  
-  click: function() {
-    var view = OB.Utilities.determineViewOfFormItem(this);
-    if (view) {
-      view.lastFocusedItem = this;
-      // this handles the case that there was a direct click on picker icon
-      // don't set the focus when a picker is shown as it will remove the 
-      // picker directly
-      if (!this.picker || !this.picker.isVisible || !this.picker.isVisible()) {
-        this.focusInItem();
-      }
-    }
+    this.hasFocus = true;
   },
 
   blur: function(form, item){
     if (item._hasChanged && form && form.handleItemChange) {
       form.handleItemChange(this);
     }
-    return;
   },
   
   isDisabled: function(){

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to