Total Complexity | 5 |
Complexity/F | 2.5 |
Lines of Code | 28 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | $(document).ready(function() { |
||
2 | $('#content').on('click', 'a.thickbox', function(event) { |
||
3 | if (!this.dataset.initialized) { |
||
4 | event.preventDefault(); |
||
5 | |||
6 | // Add ajax to each colorbox link. This will tell to Asgard that it |
||
7 | // should show only the object view style and nothing else. |
||
8 | var link = this.href; |
||
9 | |||
10 | if (!link) { |
||
11 | link = ''; |
||
12 | } |
||
13 | |||
14 | if (link.match(/\?/)) { |
||
15 | link = link.replace(/\?/, '?ajax&'); |
||
16 | } else { |
||
17 | link += '?ajax'; |
||
18 | } |
||
19 | |||
20 | // Convert the link to use thickbox |
||
21 | this.href = link; |
||
22 | this.target = '_self'; |
||
23 | |||
24 | $(this).colorbox({maxHeight: '90%', maxWidth: '90%', fixed: true}); |
||
25 | this.dataset.initialized = true; |
||
26 | } |
||
27 | }); |
||
28 | }); |
||
29 |