Skip to content

Commit 209bf71

Browse files
ljalonenepriestley
authored and
epriestley
committedFeb 1, 2013
Add isNormalMouseEvent() to Javelin
Summary: Added isNormalMouseEvent() that returns true if left mouse button triggered event click, mousedown or mouseup. Modified isNormalMouseClick() to use new function. Test Plan: Verified that new function works for click, mousedown and mouseup events. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2475 Differential Revision: https://secure.phabricator.com/D4778
1 parent 384244f commit 209bf71

File tree

2 files changed

+86
-69
lines changed

2 files changed

+86
-69
lines changed
 

‎externals/javelinjs/src/core/Event.js

+22-5
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,18 @@ JX.install('Event', {
133133
var r = this.getRawEvent();
134134
return r.which == 3 || r.button == 2;
135135
},
136-
137-
136+
138137
/**
139-
* Determine if a click event is a normal click (left mouse button, no
138+
* Determine if a mouse event is a normal event (left mouse button, no
140139
* modifier keys).
141140
*
142141
* @return bool
143142
* @task info
144143
*/
145-
isNormalClick : function() {
146-
if (this.getType() != 'click') {
144+
isNormalMouseEvent : function() {
145+
var supportedEvents = ['click','mouseup','mousedown'];
146+
147+
if (supportedEvents.indexOf(this.getType()) == -1) {
147148
return false;
148149
}
149150

@@ -164,6 +165,22 @@ JX.install('Event', {
164165
},
165166

166167

168+
/**
169+
* Determine if a click event is a normal click (left mouse button, no
170+
* modifier keys).
171+
*
172+
* @return bool
173+
* @task info
174+
*/
175+
isNormalClick : function() {
176+
if (this.getType() != 'click') {
177+
return false;
178+
}
179+
180+
return this.isNormalMouseEvent();
181+
},
182+
183+
167184
/**
168185
* Get the node corresponding to the specified key in this event's node map.
169186
* This is a simple helper method that makes the API for accessing nodes

‎src/__celerity_resource_map__.php

+64-64
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,7 @@
18501850
),
18511851
'javelin-behavior-pholio-mock-view' =>
18521852
array(
1853-
'uri' => '/res/10fbdca1/rsrc/js/application/pholio/behavior-pholio-mock-view.js',
1853+
'uri' => '/res/e7946465/rsrc/js/application/pholio/behavior-pholio-mock-view.js',
18541854
'type' => 'js',
18551855
'requires' =>
18561856
array(
@@ -2038,7 +2038,7 @@
20382038
),
20392039
'javelin-event' =>
20402040
array(
2041-
'uri' => '/res/3815b473/rsrc/js/javelin/core/Event.js',
2041+
'uri' => '/res/fdb41aa9/rsrc/js/javelin/core/Event.js',
20422042
'type' => 'js',
20432043
'requires' =>
20442044
array(
@@ -2694,7 +2694,7 @@
26942694
),
26952695
'phabricator-header-view-css' =>
26962696
array(
2697-
'uri' => '/res/0ac01450/rsrc/css/layout/phabricator-header-view.css',
2697+
'uri' => '/res/585b771c/rsrc/css/layout/phabricator-header-view.css',
26982698
'type' => 'css',
26992699
'requires' =>
27002700
array(
@@ -3380,7 +3380,7 @@
33803380
), array(
33813381
'packages' =>
33823382
array(
3383-
'409233b7' =>
3383+
'6ea96b26' =>
33843384
array(
33853385
'name' => 'core.pkg.css',
33863386
'symbols' =>
@@ -3424,7 +3424,7 @@
34243424
36 => 'phabricator-object-item-list-view-css',
34253425
37 => 'global-drag-and-drop-css',
34263426
),
3427-
'uri' => '/res/pkg/409233b7/core.pkg.css',
3427+
'uri' => '/res/pkg/6ea96b26/core.pkg.css',
34283428
'type' => 'css',
34293429
),
34303430
'8a3f0fbd' =>
@@ -3555,7 +3555,7 @@
35553555
'uri' => '/res/pkg/f96657b8/diffusion.pkg.js',
35563556
'type' => 'js',
35573557
),
3558-
'fbeded59' =>
3558+
'5f5e63ce' =>
35593559
array(
35603560
'name' => 'javelin.pkg.js',
35613561
'symbols' =>
@@ -3580,7 +3580,7 @@
35803580
17 => 'javelin-typeahead-ondemand-source',
35813581
18 => 'javelin-tokenizer',
35823582
),
3583-
'uri' => '/res/pkg/fbeded59/javelin.pkg.js',
3583+
'uri' => '/res/pkg/5f5e63ce/javelin.pkg.js',
35843584
'type' => 'js',
35853585
),
35863586
'e30a3fa8' =>
@@ -3614,19 +3614,19 @@
36143614
'reverse' =>
36153615
array(
36163616
'aphront-attached-file-view-css' => 'e30a3fa8',
3617-
'aphront-crumbs-view-css' => '409233b7',
3618-
'aphront-dialog-view-css' => '409233b7',
3619-
'aphront-error-view-css' => '409233b7',
3620-
'aphront-form-view-css' => '409233b7',
3617+
'aphront-crumbs-view-css' => '6ea96b26',
3618+
'aphront-dialog-view-css' => '6ea96b26',
3619+
'aphront-error-view-css' => '6ea96b26',
3620+
'aphront-form-view-css' => '6ea96b26',
36213621
'aphront-headsup-action-list-view-css' => 'ec01d039',
3622-
'aphront-headsup-view-css' => '409233b7',
3623-
'aphront-list-filter-view-css' => '409233b7',
3624-
'aphront-pager-view-css' => '409233b7',
3625-
'aphront-panel-view-css' => '409233b7',
3626-
'aphront-table-view-css' => '409233b7',
3627-
'aphront-tokenizer-control-css' => '409233b7',
3628-
'aphront-tooltip-css' => '409233b7',
3629-
'aphront-typeahead-control-css' => '409233b7',
3622+
'aphront-headsup-view-css' => '6ea96b26',
3623+
'aphront-list-filter-view-css' => '6ea96b26',
3624+
'aphront-pager-view-css' => '6ea96b26',
3625+
'aphront-panel-view-css' => '6ea96b26',
3626+
'aphront-table-view-css' => '6ea96b26',
3627+
'aphront-tokenizer-control-css' => '6ea96b26',
3628+
'aphront-tooltip-css' => '6ea96b26',
3629+
'aphront-typeahead-control-css' => '6ea96b26',
36303630
'differential-changeset-view-css' => 'ec01d039',
36313631
'differential-core-view-css' => 'ec01d039',
36323632
'differential-inline-comment-editor' => '9dae5f20',
@@ -3640,10 +3640,10 @@
36403640
'differential-table-of-contents-css' => 'ec01d039',
36413641
'diffusion-commit-view-css' => 'c8ce2d88',
36423642
'diffusion-icons-css' => 'c8ce2d88',
3643-
'global-drag-and-drop-css' => '409233b7',
3643+
'global-drag-and-drop-css' => '6ea96b26',
36443644
'inline-comment-summary-css' => 'ec01d039',
36453645
'javelin-aphlict' => '8a3f0fbd',
3646-
'javelin-behavior' => 'fbeded59',
3646+
'javelin-behavior' => '5f5e63ce',
36473647
'javelin-behavior-aphlict-dropdown' => '8a3f0fbd',
36483648
'javelin-behavior-aphlict-listen' => '8a3f0fbd',
36493649
'javelin-behavior-aphront-basic-tokenizer' => '8a3f0fbd',
@@ -3692,66 +3692,66 @@
36923692
'javelin-behavior-repository-crossreference' => '9dae5f20',
36933693
'javelin-behavior-toggle-class' => '8a3f0fbd',
36943694
'javelin-behavior-workflow' => '8a3f0fbd',
3695-
'javelin-dom' => 'fbeded59',
3696-
'javelin-event' => 'fbeded59',
3697-
'javelin-install' => 'fbeded59',
3698-
'javelin-json' => 'fbeded59',
3699-
'javelin-mask' => 'fbeded59',
3700-
'javelin-request' => 'fbeded59',
3701-
'javelin-resource' => 'fbeded59',
3702-
'javelin-stratcom' => 'fbeded59',
3703-
'javelin-tokenizer' => 'fbeded59',
3704-
'javelin-typeahead' => 'fbeded59',
3705-
'javelin-typeahead-normalizer' => 'fbeded59',
3706-
'javelin-typeahead-ondemand-source' => 'fbeded59',
3707-
'javelin-typeahead-preloaded-source' => 'fbeded59',
3708-
'javelin-typeahead-source' => 'fbeded59',
3709-
'javelin-uri' => 'fbeded59',
3710-
'javelin-util' => 'fbeded59',
3711-
'javelin-vector' => 'fbeded59',
3712-
'javelin-workflow' => 'fbeded59',
3713-
'lightbox-attachment-css' => '409233b7',
3695+
'javelin-dom' => '5f5e63ce',
3696+
'javelin-event' => '5f5e63ce',
3697+
'javelin-install' => '5f5e63ce',
3698+
'javelin-json' => '5f5e63ce',
3699+
'javelin-mask' => '5f5e63ce',
3700+
'javelin-request' => '5f5e63ce',
3701+
'javelin-resource' => '5f5e63ce',
3702+
'javelin-stratcom' => '5f5e63ce',
3703+
'javelin-tokenizer' => '5f5e63ce',
3704+
'javelin-typeahead' => '5f5e63ce',
3705+
'javelin-typeahead-normalizer' => '5f5e63ce',
3706+
'javelin-typeahead-ondemand-source' => '5f5e63ce',
3707+
'javelin-typeahead-preloaded-source' => '5f5e63ce',
3708+
'javelin-typeahead-source' => '5f5e63ce',
3709+
'javelin-uri' => '5f5e63ce',
3710+
'javelin-util' => '5f5e63ce',
3711+
'javelin-vector' => '5f5e63ce',
3712+
'javelin-workflow' => '5f5e63ce',
3713+
'lightbox-attachment-css' => '6ea96b26',
37143714
'maniphest-task-summary-css' => 'e30a3fa8',
37153715
'maniphest-transaction-detail-css' => 'e30a3fa8',
37163716
'phabricator-busy' => '8a3f0fbd',
37173717
'phabricator-content-source-view-css' => 'ec01d039',
3718-
'phabricator-core-buttons-css' => '409233b7',
3719-
'phabricator-core-css' => '409233b7',
3720-
'phabricator-crumbs-view-css' => '409233b7',
3721-
'phabricator-directory-css' => '409233b7',
3718+
'phabricator-core-buttons-css' => '6ea96b26',
3719+
'phabricator-core-css' => '6ea96b26',
3720+
'phabricator-crumbs-view-css' => '6ea96b26',
3721+
'phabricator-directory-css' => '6ea96b26',
37223722
'phabricator-drag-and-drop-file-upload' => '9dae5f20',
37233723
'phabricator-dropdown-menu' => '8a3f0fbd',
37243724
'phabricator-file-upload' => '8a3f0fbd',
3725-
'phabricator-filetree-view-css' => '409233b7',
3726-
'phabricator-flag-css' => '409233b7',
3727-
'phabricator-form-view-css' => '409233b7',
3728-
'phabricator-header-view-css' => '409233b7',
3729-
'phabricator-jump-nav' => '409233b7',
3725+
'phabricator-filetree-view-css' => '6ea96b26',
3726+
'phabricator-flag-css' => '6ea96b26',
3727+
'phabricator-form-view-css' => '6ea96b26',
3728+
'phabricator-header-view-css' => '6ea96b26',
3729+
'phabricator-jump-nav' => '6ea96b26',
37303730
'phabricator-keyboard-shortcut' => '8a3f0fbd',
37313731
'phabricator-keyboard-shortcut-manager' => '8a3f0fbd',
3732-
'phabricator-main-menu-view' => '409233b7',
3732+
'phabricator-main-menu-view' => '6ea96b26',
37333733
'phabricator-menu-item' => '8a3f0fbd',
3734-
'phabricator-nav-view-css' => '409233b7',
3734+
'phabricator-nav-view-css' => '6ea96b26',
37353735
'phabricator-notification' => '8a3f0fbd',
3736-
'phabricator-notification-css' => '409233b7',
3737-
'phabricator-notification-menu-css' => '409233b7',
3738-
'phabricator-object-item-list-view-css' => '409233b7',
3736+
'phabricator-notification-css' => '6ea96b26',
3737+
'phabricator-notification-menu-css' => '6ea96b26',
3738+
'phabricator-object-item-list-view-css' => '6ea96b26',
37393739
'phabricator-object-selector-css' => 'ec01d039',
37403740
'phabricator-paste-file-upload' => '8a3f0fbd',
37413741
'phabricator-prefab' => '8a3f0fbd',
37423742
'phabricator-project-tag-css' => 'e30a3fa8',
3743-
'phabricator-remarkup-css' => '409233b7',
3743+
'phabricator-remarkup-css' => '6ea96b26',
37443744
'phabricator-shaped-request' => '9dae5f20',
3745-
'phabricator-side-menu-view-css' => '409233b7',
3746-
'phabricator-standard-page-view' => '409233b7',
3745+
'phabricator-side-menu-view-css' => '6ea96b26',
3746+
'phabricator-standard-page-view' => '6ea96b26',
37473747
'phabricator-textareautils' => '8a3f0fbd',
37483748
'phabricator-tooltip' => '8a3f0fbd',
3749-
'phabricator-transaction-view-css' => '409233b7',
3750-
'phabricator-zindex-css' => '409233b7',
3751-
'sprite-apps-large-css' => '409233b7',
3752-
'sprite-gradient-css' => '409233b7',
3753-
'sprite-icon-css' => '409233b7',
3754-
'sprite-menu-css' => '409233b7',
3755-
'syntax-highlighting-css' => '409233b7',
3749+
'phabricator-transaction-view-css' => '6ea96b26',
3750+
'phabricator-zindex-css' => '6ea96b26',
3751+
'sprite-apps-large-css' => '6ea96b26',
3752+
'sprite-gradient-css' => '6ea96b26',
3753+
'sprite-icon-css' => '6ea96b26',
3754+
'sprite-menu-css' => '6ea96b26',
3755+
'syntax-highlighting-css' => '6ea96b26',
37563756
),
37573757
));

0 commit comments

Comments
 (0)
Failed to load comments.