1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Fix tab-focus of Tokenizers

Summary: Fixes T3140. Previously, we added the highlight class only on explicit events, but not on actual focus events (e.g., via tab).

Test Plan: Tabbed into a tokenizer. Clicked a tokenizer. Tabbed out of a tokenizer. Clicked out of a tokenizer. Shift-tabbed out of a tokenizer. Verified highlight state was always correct.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3140

Differential Revision: https://secure.phabricator.com/D5891
This commit is contained in:
epriestley 2013-05-10 10:23:32 -07:00
parent 511485169a
commit 8410a8019a
2 changed files with 28 additions and 25 deletions

View file

@ -2561,7 +2561,7 @@ celerity_register_resource_map(array(
),
'javelin-tokenizer' =>
array(
'uri' => '/res/8bccdb9e/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js',
'uri' => '/res/2c55cb68/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js',
'type' => 'js',
'requires' =>
array(
@ -4185,7 +4185,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/f96657b8/diffusion.pkg.js',
'type' => 'js',
),
'7d174323' =>
'202a3dd0' =>
array(
'name' => 'javelin.pkg.js',
'symbols' =>
@ -4210,7 +4210,7 @@ celerity_register_resource_map(array(
17 => 'javelin-typeahead-ondemand-source',
18 => 'javelin-tokenizer',
),
'uri' => '/res/pkg/7d174323/javelin.pkg.js',
'uri' => '/res/pkg/202a3dd0/javelin.pkg.js',
'type' => 'js',
),
'6b1fccc6' =>
@ -4270,7 +4270,7 @@ celerity_register_resource_map(array(
'global-drag-and-drop-css' => '56e0b740',
'inline-comment-summary-css' => 'dd27a69b',
'javelin-aphlict' => '26980a1c',
'javelin-behavior' => '7d174323',
'javelin-behavior' => '202a3dd0',
'javelin-behavior-aphlict-dropdown' => '26980a1c',
'javelin-behavior-aphlict-listen' => '26980a1c',
'javelin-behavior-aphront-basic-tokenizer' => '26980a1c',
@ -4321,24 +4321,24 @@ celerity_register_resource_map(array(
'javelin-behavior-repository-crossreference' => '27c55b30',
'javelin-behavior-toggle-class' => '26980a1c',
'javelin-behavior-workflow' => '26980a1c',
'javelin-dom' => '7d174323',
'javelin-event' => '7d174323',
'javelin-install' => '7d174323',
'javelin-json' => '7d174323',
'javelin-mask' => '7d174323',
'javelin-request' => '7d174323',
'javelin-resource' => '7d174323',
'javelin-stratcom' => '7d174323',
'javelin-tokenizer' => '7d174323',
'javelin-typeahead' => '7d174323',
'javelin-typeahead-normalizer' => '7d174323',
'javelin-typeahead-ondemand-source' => '7d174323',
'javelin-typeahead-preloaded-source' => '7d174323',
'javelin-typeahead-source' => '7d174323',
'javelin-uri' => '7d174323',
'javelin-util' => '7d174323',
'javelin-vector' => '7d174323',
'javelin-workflow' => '7d174323',
'javelin-dom' => '202a3dd0',
'javelin-event' => '202a3dd0',
'javelin-install' => '202a3dd0',
'javelin-json' => '202a3dd0',
'javelin-mask' => '202a3dd0',
'javelin-request' => '202a3dd0',
'javelin-resource' => '202a3dd0',
'javelin-stratcom' => '202a3dd0',
'javelin-tokenizer' => '202a3dd0',
'javelin-typeahead' => '202a3dd0',
'javelin-typeahead-normalizer' => '202a3dd0',
'javelin-typeahead-ondemand-source' => '202a3dd0',
'javelin-typeahead-preloaded-source' => '202a3dd0',
'javelin-typeahead-source' => '202a3dd0',
'javelin-uri' => '202a3dd0',
'javelin-util' => '202a3dd0',
'javelin-vector' => '202a3dd0',
'javelin-workflow' => '202a3dd0',
'lightbox-attachment-css' => '56e0b740',
'maniphest-task-summary-css' => '6b1fccc6',
'maniphest-transaction-detail-css' => '6b1fccc6',

View file

@ -213,6 +213,8 @@ JX.install('Tokenizer', {
// Explicitly update the placeholder since we just wiped the field
// value.
this._typeahead.updatePlaceholder();
} else if (e.getType() == 'focus') {
this._didfocus();
}
},
@ -380,16 +382,17 @@ JX.install('Tokenizer', {
focus : function() {
var focus = this._focus;
JX.DOM.show(focus);
setTimeout(function() { JX.DOM.focus(focus); }, 0);
},
_didfocus : function() {
JX.DOM.alterClass(
this._containerNode,
'jx-tokenizer-container-focused',
true);
setTimeout(function() { JX.DOM.focus(focus); }, 0);
},
_didblur: function() {
_didblur : function() {
JX.DOM.alterClass(
this._containerNode,
'jx-tokenizer-container-focused',