Browse Source

Fix after moving to non-JQuery Web.

#empty (and #contents:) do not remove
events, so bubbled events may occur.

Guarded HLTabsWidget >> activate:
not to reactivate removed tab via bubbled event.
Herby Vojčík 4 years ago
parent
commit
6b9d14e3fa
2 changed files with 8 additions and 3 deletions
  1. 7 3
      src/Helios-Core.js
  2. 1 0
      src/Helios-Core.st

+ 7 - 3
src/Helios-Core.js

@@ -9465,11 +9465,15 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
+var $1,$2;
 $1=$self._isSelectionDisabled();
 if($core.assert($1)){
 return self;
 }
+$2=$recv($self._tabs())._includes_(aTab);
+if(!$core.assert($2)){
+return self;
+}
 $recv($recv($self._manager())._keyBinder())._flushBindings();
 $recv(aTab)._registerBindings();
 $self.activeTab=aTab;
@@ -9483,11 +9487,11 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aTab"],
-source: "activate: aTab\x0a\x09self isSelectionDisabled ifTrue: [ ^ self ].\x0a\x0a\x09self manager keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
+source: "activate: aTab\x0a\x09self isSelectionDisabled ifTrue: [ ^ self ].\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self manager keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifTrue:", "isSelectionDisabled", "flushBindings", "keyBinder", "manager", "registerBindings", "refresh", "addToHistory:", "show:"]
+messageSends: ["ifTrue:", "isSelectionDisabled", "ifFalse:", "includes:", "tabs", "flushBindings", "keyBinder", "manager", "registerBindings", "refresh", "addToHistory:", "show:"]
 }),
 $globals.HLTabsWidget);
 

+ 1 - 0
src/Helios-Core.st

@@ -2181,6 +2181,7 @@ tabs
 
 activate: aTab
 	self isSelectionDisabled ifTrue: [ ^ self ].
+	(self tabs includes: aTab) ifFalse: [ ^ self ].
 
 	self manager keyBinder flushBindings.
 	aTab registerBindings.