1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 17:00:59 +01:00

Prevent double lightbox in lightbox comments

Summary: Ref T3612, prevents lightbox from spawning from inside a lightbox.

Test Plan: Click on file lightbox, leave file comment, click file comment, get take to file page instead of another lightbox.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T3612

Differential Revision: https://secure.phabricator.com/D16978
This commit is contained in:
Chad Little 2016-12-02 10:52:14 -08:00
parent aa6517a42b
commit 49a20bde8e
3 changed files with 17 additions and 13 deletions

View file

@ -10,7 +10,7 @@ return array(
'conpherence.pkg.css' => '0b64e988', 'conpherence.pkg.css' => '0b64e988',
'conpherence.pkg.js' => '6249a1cf', 'conpherence.pkg.js' => '6249a1cf',
'core.pkg.css' => '27fd330b', 'core.pkg.css' => '27fd330b',
'core.pkg.js' => '14fcb9e4', 'core.pkg.js' => 'e4260032',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'a4ba74b5', 'differential.pkg.css' => 'a4ba74b5',
'differential.pkg.js' => '634399e9', 'differential.pkg.js' => '634399e9',
@ -505,7 +505,7 @@ return array(
'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', 'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64',
'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', 'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0',
'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0', 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0',
'rsrc/js/core/behavior-lightbox-attachments.js' => 'e089b29b', 'rsrc/js/core/behavior-lightbox-attachments.js' => 'ddcd41cf',
'rsrc/js/core/behavior-line-linker.js' => '1499a8cb', 'rsrc/js/core/behavior-line-linker.js' => '1499a8cb',
'rsrc/js/core/behavior-more.js' => 'a80d0378', 'rsrc/js/core/behavior-more.js' => 'a80d0378',
'rsrc/js/core/behavior-object-selector.js' => 'e0ec7f2f', 'rsrc/js/core/behavior-object-selector.js' => 'e0ec7f2f',
@ -651,7 +651,7 @@ return array(
'javelin-behavior-history-install' => '7ee2b591', 'javelin-behavior-history-install' => '7ee2b591',
'javelin-behavior-icon-composer' => '8499b6ab', 'javelin-behavior-icon-composer' => '8499b6ab',
'javelin-behavior-launch-icon-composer' => '48086888', 'javelin-behavior-launch-icon-composer' => '48086888',
'javelin-behavior-lightbox-attachments' => 'e089b29b', 'javelin-behavior-lightbox-attachments' => 'ddcd41cf',
'javelin-behavior-line-chart' => 'e4232876', 'javelin-behavior-line-chart' => 'e4232876',
'javelin-behavior-load-blame' => '42126667', 'javelin-behavior-load-blame' => '42126667',
'javelin-behavior-maniphest-batch-editor' => '782ab6e7', 'javelin-behavior-maniphest-batch-editor' => '782ab6e7',
@ -2050,14 +2050,7 @@ return array(
'javelin-util', 'javelin-util',
'phabricator-shaped-request', 'phabricator-shaped-request',
), ),
'de2e896f' => array( 'ddcd41cf' => array(
'javelin-behavior',
'javelin-dom',
'javelin-typeahead',
'javelin-typeahead-ondemand-source',
'javelin-dom',
),
'e089b29b' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-stratcom', 'javelin-stratcom',
'javelin-dom', 'javelin-dom',
@ -2066,6 +2059,13 @@ return array(
'phuix-icon-view', 'phuix-icon-view',
'phabricator-busy', 'phabricator-busy',
), ),
'de2e896f' => array(
'javelin-behavior',
'javelin-dom',
'javelin-typeahead',
'javelin-typeahead-ondemand-source',
'javelin-dom',
),
'e0ec7f2f' => array( 'e0ec7f2f' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',

View file

@ -512,6 +512,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView
'div', 'div',
array( array(
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),
'id' => 'main-page-frame',
), ),
array( array(
$main_page, $main_page,

View file

@ -50,7 +50,8 @@ JX.behavior('lightbox-attachments', function (config) {
e.kill(); e.kill();
var links = JX.DOM.scry(document, 'a', 'lightboxable'); var mainFrame = JX.$('main-page-frame');
var links = JX.DOM.scry(mainFrame, 'a', 'lightboxable');
var phids = {}; var phids = {};
var data; var data;
for (var i = 0; i < links.length; i++) { for (var i = 0; i < links.length; i++) {
@ -317,7 +318,9 @@ JX.behavior('lightbox-attachments', function (config) {
el.click(); el.click();
} }
JX.Stratcom.listen( // Only look for lightboxable inside the main page, not other lightboxes.
JX.DOM.listen(
JX.$('main-page-frame'),
'click', 'click',
['lightboxable'], ['lightboxable'],
loadLightBox); loadLightBox);