details:   https://code.openbravo.com/erp/devel/pi/rev/135bc8ba3ad0
changeset: 14889:135bc8ba3ad0
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Sun Dec 18 20:58:28 2011 +0100
summary:   Fixed issue 19327: 'attachment' viewport now is placed ok when 
toolbar icon is pressed

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
 |  15 +++++++--
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r f67f393088e1 -r 135bc8ba3ad0 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Sat Dec 17 03:06:52 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Sun Dec 18 20:58:28 2011 +0100
@@ -233,10 +233,17 @@
       var selectedRows = this.view.viewGrid.getSelectedRecords(),
           attachmentExists = this.view.attachmentExists, i;
       if(this.view.isShowingForm){
-        this.view.viewForm.getItem('_attachments_').expandSection();
-        this.view.viewForm.scrollToBottom();
+        if (!this.view.viewForm.getItem('_attachments_').isExpanded()) {
+          this.view.viewForm.getItem('_attachments_').expandSection();
+        }
+        this.view.viewForm.getItem('_attachments_').focusInItem();
+        if (this.view.viewForm.parentElement) {
+          // scroll after things have been expanded
+          this.view.viewForm.parentElement.delayCall('scrollTo', [null, 
this.view.viewForm.getItem('_attachments_').getTop()], 100);
+        }
+
         if(!attachmentExists){
-          
this.view.viewForm.getItem('_attachments_').canvasItem.canvas.getMember(0).getMember(0).click();
+          
this.view.viewForm.getItem('_attachments_').attachmentCanvasItem.canvas.getMember(0).getMember(0).click();
         }
         return;
       }
@@ -246,7 +253,7 @@
         this.view.viewForm.expandAttachments = true;
         this.view.editRecord(selectedRows[0]);
         if(!attachmentExists){
-          
this.view.viewForm.getItem('_attachments_').canvasItem.canvas.getMember(0).getMember(0).click();
+          
this.view.viewForm.getItem('_attachments_').attachmentCanvasItem.canvas.getMember(0).getMember(0).click();
         }
       } else {
         var recordIds = "";

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to