MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371622 )

Change subject: Fix unnecessary reloading of diff
......................................................................

Fix unnecessary reloading of diff

Currently, when dragging a pointer over another revision but not
releasing it until it is at the same location, the diff still reloads
This change stores the initial positions and comparing at the end.

Bug: T163425
Change-Id: I430650d12bfeb3ce4af59abe91f18cc2b861a3de
---
M modules/ext.RevisionSlider.SliderView.js
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RevisionSlider 
refs/changes/22/371622/1

diff --git a/modules/ext.RevisionSlider.SliderView.js 
b/modules/ext.RevisionSlider.SliderView.js
index 75a5691..7b6f60d 100644
--- a/modules/ext.RevisionSlider.SliderView.js
+++ b/modules/ext.RevisionSlider.SliderView.js
@@ -419,6 +419,8 @@
                                        self.setPointerDragCursor();
                                        self.fadeOutPointerLines();
                                        self.escapePressed = false;
+                                       self.startOldPointerPosition = 
self.getOlderPointerPos();
+                                       self.startNewPointerPosition = 
self.getNewerPointerPos();
                                },
                                stop: function () {
                                        var $p = $( this ),
@@ -445,6 +447,11 @@
                                                $revisions, 
self.getOlderPointerPos()
                                        ).data( 'revid' );
 
+                                       if ( self.getNewerPointerPos() === 
self.startNewPointerPosition ||
+                                               self.getOlderPointerPos() === 
self.startOldPointerPosition ) {
+                                               return;
+                                       }
+
                                        self.refreshDiffView( diff, oldid, true 
);
                                        self.alignPointersAndLines( 0 );
                                        
self.resetRevisionStylesBasedOnPointerPosition( $revisions );

-- 
To view, visit https://gerrit.wikimedia.org/r/371622
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I430650d12bfeb3ce4af59abe91f18cc2b861a3de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: MtDu <justin.d...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to