1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Fix two tokenizer issues on iDevices

Summary: Fixes T3853. See inline comments for details.

Test Plan: Using iOS simulator, mashed the right hand side of tokenizers.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T3853

Differential Revision: https://secure.phabricator.com/D7049
This commit is contained in:
epriestley 2013-09-19 15:42:02 -07:00
parent b51b780e56
commit 6bc5ed39a2
2 changed files with 41 additions and 25 deletions

View file

@ -2667,7 +2667,7 @@ celerity_register_resource_map(array(
),
'javelin-tokenizer' =>
array(
'uri' => '/res/1867b9e3/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js',
'uri' => '/res/cddb70f3/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js',
'type' => 'js',
'requires' =>
array(
@ -4351,7 +4351,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/96909266/diffusion.pkg.js',
'type' => 'js',
),
'a68dc06a' =>
'9564fa17' =>
array(
'name' => 'javelin.pkg.js',
'symbols' =>
@ -4377,7 +4377,7 @@ celerity_register_resource_map(array(
18 => 'javelin-tokenizer',
19 => 'javelin-history',
),
'uri' => '/res/pkg/a68dc06a/javelin.pkg.js',
'uri' => '/res/pkg/9564fa17/javelin.pkg.js',
'type' => 'js',
),
'36d5d071' =>
@ -4434,7 +4434,7 @@ celerity_register_resource_map(array(
'global-drag-and-drop-css' => 'b1d5e69b',
'inline-comment-summary-css' => '44bfe40c',
'javelin-aphlict' => '8977e356',
'javelin-behavior' => 'a68dc06a',
'javelin-behavior' => '9564fa17',
'javelin-behavior-aphlict-dropdown' => '8977e356',
'javelin-behavior-aphlict-listen' => '8977e356',
'javelin-behavior-aphront-basic-tokenizer' => '8977e356',
@ -4485,25 +4485,25 @@ celerity_register_resource_map(array(
'javelin-behavior-repository-crossreference' => '5e9e5c4e',
'javelin-behavior-toggle-class' => '8977e356',
'javelin-behavior-workflow' => '8977e356',
'javelin-dom' => 'a68dc06a',
'javelin-event' => 'a68dc06a',
'javelin-history' => 'a68dc06a',
'javelin-install' => 'a68dc06a',
'javelin-json' => 'a68dc06a',
'javelin-mask' => 'a68dc06a',
'javelin-request' => 'a68dc06a',
'javelin-resource' => 'a68dc06a',
'javelin-stratcom' => 'a68dc06a',
'javelin-tokenizer' => 'a68dc06a',
'javelin-typeahead' => 'a68dc06a',
'javelin-typeahead-normalizer' => 'a68dc06a',
'javelin-typeahead-ondemand-source' => 'a68dc06a',
'javelin-typeahead-preloaded-source' => 'a68dc06a',
'javelin-typeahead-source' => 'a68dc06a',
'javelin-uri' => 'a68dc06a',
'javelin-util' => 'a68dc06a',
'javelin-vector' => 'a68dc06a',
'javelin-workflow' => 'a68dc06a',
'javelin-dom' => '9564fa17',
'javelin-event' => '9564fa17',
'javelin-history' => '9564fa17',
'javelin-install' => '9564fa17',
'javelin-json' => '9564fa17',
'javelin-mask' => '9564fa17',
'javelin-request' => '9564fa17',
'javelin-resource' => '9564fa17',
'javelin-stratcom' => '9564fa17',
'javelin-tokenizer' => '9564fa17',
'javelin-typeahead' => '9564fa17',
'javelin-typeahead-normalizer' => '9564fa17',
'javelin-typeahead-ondemand-source' => '9564fa17',
'javelin-typeahead-preloaded-source' => '9564fa17',
'javelin-typeahead-source' => '9564fa17',
'javelin-uri' => '9564fa17',
'javelin-util' => '9564fa17',
'javelin-vector' => '9564fa17',
'javelin-workflow' => '9564fa17',
'lightbox-attachment-css' => 'b1d5e69b',
'maniphest-task-summary-css' => '36d5d071',
'maniphest-transaction-detail-css' => '36d5d071',

View file

@ -93,6 +93,15 @@ JX.install('Tokenizer', {
null,
JX.bind(this, this.handleEvent));
// NOTE: Safari on the iPhone does not normally delegate click events on
// <div /> tags. This causes the event to fire. We want a click (in this
// case, a touch) anywhere in the div to trigger this event so that we
// can focus the input. Without this, you must tap an arbitrary area on
// the left side of the input to focus it.
//
// http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
input_container.onclick = JX.bag;
JX.DOM.listen(
input_container,
'click',
@ -193,7 +202,6 @@ JX.install('Tokenizer', {
},
handleEvent : function(e) {
this._typeahead.handleEvent(e);
if (e.getPrevented()) {
return;
@ -392,7 +400,15 @@ JX.install('Tokenizer', {
focus : function() {
var focus = this._focus;
JX.DOM.show(focus);
setTimeout(function() { JX.DOM.focus(focus); }, 0);
// NOTE: We must fire this focus event immediately (during event
// handling) for the iPhone to bring up the keyboard. Previously this
// focus was wrapped in setTimeout(), but it's unclear why that was
// necessary. If this is adjusted later, make sure tapping the inactive
// area of the tokenizer to focus it on the iPhone still brings up the
// keyboard.
JX.DOM.focus(focus);
},
_didfocus : function() {