Przeglądaj źródła

HLListWidget navigation: prevent scrolling of parent div

Nicolas Petton 11 lat temu
rodzic
commit
4292bd9def
3 zmienionych plików z 17 dodań i 7 usunięć
  1. 6 2
      js/Helios-Core.deploy.js
  2. 5 3
      js/Helios-Core.js
  3. 6 2
      st/Helios-Core.st

+ 6 - 2
js/Helios-Core.deploy.js

@@ -1910,6 +1910,7 @@ return _st(active).__eq(false);
 if(smalltalk.assert($1)){
 active=true;
 active;
+_st(e)._preventDefault();
 _st(self)._activatePreviousListItem();
 delay=_st((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -1938,6 +1939,7 @@ return _st(delay)._clearTimeout();
 return interval;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._valueWithTimeout_((300));
 delay;
+false;
 };
 $5=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -1946,6 +1948,7 @@ return _st(active).__eq(false);
 if(smalltalk.assert($5)){
 active=true;
 active;
+_st(e)._preventDefault();
 _st(self)._activateNextListItem();
 delay=_st((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -1973,8 +1976,9 @@ return _st(delay)._clearTimeout();
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}))._valueWithInterval_(repeatInterval);
 return interval;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._valueWithTimeout_((300));
-return delay;
+delay;
 };
+return false;
 }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
 _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
 return smalltalk.withContext(function($ctx2) {
@@ -1997,7 +2001,7 @@ return _st(delay)._clearTimeout();
 };
 }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
-messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "ifTrue:ifFalse:", "ifNotNil:", "clearInterval", "clearTimeout", "hasClass:", "focusClass", "and:", "=", "which", "activateNextListItem", "keyup:"]}),
+messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "preventDefault", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "ifTrue:ifFalse:", "ifNotNil:", "clearInterval", "clearTimeout", "hasClass:", "focusClass", "and:", "=", "which", "activateNextListItem", "keyup:"]}),
 smalltalk.HLListWidget);
 
 

Plik diff jest za duży
+ 5 - 3
js/Helios-Core.js


+ 6 - 2
st/Helios-Core.st

@@ -858,6 +858,7 @@ setupKeyBindings
 		
         (e which = 38 and: [ active = false ]) ifTrue: [ 
 			active := true.
+			e preventDefault.
 			self activatePreviousListItem.
         	delay := [
 				interval := [
@@ -869,10 +870,12 @@ setupKeyBindings
 							interval ifNotNil: [ interval clearInterval ].
 							delay ifNotNil: [ delay clearTimeout] ] ]
 					valueWithInterval: repeatInterval ]
-						valueWithTimeout: 300 ].
+						valueWithTimeout: 300.
+					false ].
 			
       	(e which = 40 and: [ active = false ]) ifTrue: [
             active := true.
+			e preventDefault.
 			self activateNextListItem.
         	delay := [
 				interval := [ 
@@ -884,7 +887,8 @@ setupKeyBindings
 							interval ifNotNil: [ interval clearInterval ].
 							delay ifNotNil: [ delay clearTimeout] ] ]
 					valueWithInterval: repeatInterval ]
-						valueWithTimeout: 300 ] ].
+						valueWithTimeout: 300 ].
+					false ].
 	
 	self wrapper asJQuery keyup: [ :e |
 		active ifTrue: [

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików