Browse Source

helios: progress bar flush fix

Nicolas Petton 11 years ago
parent
commit
1bfbb9fc7f
3 changed files with 24 additions and 17 deletions
  1. 16 6
      js/Helios-Core.deploy.js
  2. 1 5
      js/Helios-Core.js
  3. 7 6
      st/Helios-Core.st

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

@@ -1910,7 +1910,6 @@ 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) {
@@ -1939,7 +1938,6 @@ 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) {
@@ -1948,7 +1946,6 @@ 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) {
@@ -1976,9 +1973,8 @@ return _st(delay)._clearTimeout();
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}))._valueWithInterval_(repeatInterval);
 return interval;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._valueWithTimeout_((300));
-delay;
+return delay;
 };
-return false;
 }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
 _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
 return smalltalk.withContext(function($ctx2) {
@@ -2001,7 +1997,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:", "preventDefault", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "ifTrue:ifFalse:", "ifNotNil:", "clearInterval", "clearTimeout", "hasClass:", "focusClass", "and:", "=", "which", "activateNextListItem", "keyup:"]}),
+messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "ifTrue:ifFalse:", "ifNotNil:", "clearInterval", "clearTimeout", "hasClass:", "focusClass", "and:", "=", "which", "activateNextListItem", "keyup:"]}),
 smalltalk.HLListWidget);
 
 
@@ -3344,6 +3340,20 @@ return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBloc
 messageSends: ["parent:", "new", "label:", "workBlock:", "collection:", "yourself", "addProgressBar:", "start"]}),
 smalltalk.HLProgressWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "flush",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._progressBars())._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._removeProgressBar_(each);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.HLProgressWidget)})},
+messageSends: ["do:", "removeProgressBar:", "progressBars"]}),
+smalltalk.HLProgressWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isVisible",

File diff suppressed because it is too large
+ 1 - 5
js/Helios-Core.js


+ 7 - 6
st/Helios-Core.st

@@ -858,7 +858,6 @@ setupKeyBindings
 		
         (e which = 38 and: [ active = false ]) ifTrue: [ 
 			active := true.
-			e preventDefault.
 			self activatePreviousListItem.
         	delay := [
 				interval := [
@@ -870,12 +869,10 @@ setupKeyBindings
 							interval ifNotNil: [ interval clearInterval ].
 							delay ifNotNil: [ delay clearTimeout] ] ]
 					valueWithInterval: repeatInterval ]
-						valueWithTimeout: 300.
-					false ].
+						valueWithTimeout: 300 ].
 			
       	(e which = 40 and: [ active = false ]) ifTrue: [
             active := true.
-			e preventDefault.
 			self activateNextListItem.
         	delay := [
 				interval := [ 
@@ -887,8 +884,7 @@ setupKeyBindings
 							interval ifNotNil: [ interval clearInterval ].
 							delay ifNotNil: [ delay clearTimeout] ] ]
 					valueWithInterval: repeatInterval ]
-						valueWithTimeout: 300 ].
-					false ].
+						valueWithTimeout: 300 ] ].
 	
 	self wrapper asJQuery keyup: [ :e |
 		active ifTrue: [
@@ -1568,6 +1564,11 @@ do: aBlock on: aCollection displaying: aString
 	progressBar start
 !
 
+flush
+	self progressBars do: [ :each |
+		self removeProgressBar: each ]
+!
+
 remove
 	self isVisible ifTrue: [
 		visible := false.

Some files were not shown because too many files changed in this diff