Alexander Wels has uploaded a new change for review.

Change subject: webadmin: remove table focus.
......................................................................

webadmin: remove table focus.

- Removed focus from AbstractActionTable when selecting
a row. This stops a scroll on refresh of the table.
- Undo most of Change-Id: I0f34a369ba1074456614ad65b7e4cc77af963853
as that was just bandaid instead of a fix.

Change-Id: Ie6945d18bcd30b02d4428d20d83bf194fcf207eb
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=882618
Signed-off-by: Alexander Wels <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/AbstractActionTable.java
1 file changed, 4 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/81/13981/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/AbstractActionTable.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/AbstractActionTable.java
index 02f9374..0f33641 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/AbstractActionTable.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/AbstractActionTable.java
@@ -121,9 +121,6 @@
     // Table container's horizontal scroll position, used to align table 
header with main table
     private int tableContainerHorizontalScrollPosition = 0;
 
-    // Table container's vertical scroll position, used to retain table scroll 
position after data refresh
-    private int tableContainerVerticalScrollPosition = 0;
-
     public AbstractActionTable(final SearchableTableModelProvider<T, ?> 
dataProvider,
             Resources resources, Resources headerResources, EventBus eventBus) 
{
         super(dataProvider, eventBus);
@@ -140,6 +137,10 @@
                     selectionModel.setMultiSelectEnabled(event.getCtrlKey());
                     
selectionModel.setMultiRangeSelectEnabled(event.getShiftKey());
                 }
+                //Remove focus from the table so refreshes won't try to focus 
on the
+                //selected row. This important when the user has scrolled the 
selected
+                //row off the screen, we don't want the browser to scroll back.
+                table.setFocus(false);
                 super.onBrowserEvent2(event);
             }
 
@@ -172,13 +173,6 @@
                 super.setRowData(start, values);
                 selectionModel.resolveChanges();
                 updateTableControls();
-
-                Scheduler.get().scheduleDeferred(new ScheduledCommand() {
-                     @Override
-                     public void execute() {
-                         
tableContainer.getElement().setScrollTop(tableContainerVerticalScrollPosition);
-                     }
-                });
             }
 
             @Override
@@ -355,11 +349,9 @@
             @Override
             public void onScroll(ScrollEvent event) {
                 tableContainerHorizontalScrollPosition = 
tableContainer.getElement().getScrollLeft();
-                tableContainerVerticalScrollPosition = 
tableContainer.getElement().getScrollTop();
                 updateTableHeaderPosition();
             }
         }, ScrollEvent.getType());
-
         // Reset main table container's scroll position
         enforceScrollPosition();
     }


--
To view, visit http://gerrit.ovirt.org/13981
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6945d18bcd30b02d4428d20d83bf194fcf207eb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to