1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-16 16:58:38 +01:00

Avoid JS error in clicking on <a> without href

Test Plan: Removed name from typeahead.

Reviewers: alanh

Reviewed By: alanh

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D3343
This commit is contained in:
vrana 2012-08-20 14:20:13 -07:00
parent 16e8c4a493
commit 8901fdbd3e
2 changed files with 2 additions and 2 deletions

View file

@ -1186,7 +1186,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-differential-toggle-files' =>
array(
'uri' => '/res/fb94e3f5/rsrc/js/application/differential/behavior-toggle-files.js',
'uri' => '/res/983960b4/rsrc/js/application/differential/behavior-toggle-files.js',
'type' => 'js',
'requires' =>
array(

View file

@ -59,7 +59,7 @@ JX.behavior('differential-toggle-files', function(config) {
function(e) {
var link = e.getNode('tag:a');
var id = link.getAttribute('href');
if (!id.match(/^#.+/)) {
if (!id || !id.match(/^#.+/)) {
return;
}
// The target may have either a matching name or a matching id.