Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/behavior-lightbox-attachments.js
Show All 15 Lines | JX.behavior('lightbox-attachments', function (config) { | ||||
var next = null; | var next = null; | ||||
var downloadForm = JX.$H(config.downloadForm).getFragment().firstChild; | var downloadForm = JX.$H(config.downloadForm).getFragment().firstChild; | ||||
function loadLightBox(e) { | function loadLightBox(e) { | ||||
if (!e.isNormalClick()) { | if (!e.isNormalClick()) { | ||||
return; | return; | ||||
} | } | ||||
if (JX.Stratcom.pass()) { | e.kill(); | ||||
return; | |||||
} | |||||
e.prevent(); | |||||
var links = JX.DOM.scry(document, 'a', 'lightboxable'); | var links = JX.DOM.scry(document, '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++) { | ||||
data = JX.Stratcom.getData(links[i]); | data = JX.Stratcom.getData(links[i]); | ||||
phids[data.phid] = links[i]; | phids[data.phid] = links[i]; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | function loadAnotherLightBox(el, e) { | ||||
} | } | ||||
e.prevent(); | e.prevent(); | ||||
closeLightBox(e); | closeLightBox(e); | ||||
el.click(); | el.click(); | ||||
} | } | ||||
JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
'click', | 'click', | ||||
['lightboxable', 'tag:a'], | ['lightboxable'], | ||||
loadLightBox); | loadLightBox); | ||||
JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
'keydown', | 'keydown', | ||||
null, | null, | ||||
lightBoxHandleKeyDown); | lightBoxHandleKeyDown); | ||||
// When the user clicks the background, close the lightbox. | // When the user clicks the background, close the lightbox. | ||||
Show All 17 Lines |