|
1 | 1 |
|
| 2 | +var ranbefore = false; |
| 3 | + |
2 | 4 | $(document).ready(function() { |
3 | 5 | if(/(public)\.php/i.exec(window.location.href)!=null) return; |
4 | 6 | setTimeout(addShareListener, 1000); |
5 | 7 | }); |
6 | 8 |
|
7 | 9 | function addShareListener() { |
8 | | - $('.action-share').click(function() { |
9 | | - $('#linkCheckbox').click(function() { |
| 10 | + if (!ranbefore) { |
| 11 | + addGlobalListener('.nav-files'); |
| 12 | + addGlobalListener('.nav-sharingin'); |
| 13 | + addGlobalListener('.nav-sharingout'); |
| 14 | + addGlobalListener('.nav-sharinglinks'); |
| 15 | + addGlobalListener('.name'); |
| 16 | + addGlobalListener('.crumb'); |
| 17 | + ranbefore = true; |
| 18 | + } |
| 19 | + $('.action-share').ready(function() { |
| 20 | + $('.action-share').click(function() { |
| 21 | + addListener('#linkCheckbox'); |
10 | 22 | setTimeout(replaceUrl, 750); |
11 | 23 | }); |
12 | | - setTimeout(replaceUrl, 750); |
| 24 | + }); |
| 25 | +} |
| 26 | + |
| 27 | +function addListener(o) { |
| 28 | + $(o).ready(function() { |
| 29 | + $(o).click(function() { |
| 30 | + setTimeout(replaceUrl, 750); |
| 31 | + }); |
| 32 | + }); |
| 33 | +} |
| 34 | + |
| 35 | +function addGlobalListener(o) { |
| 36 | + $(o).ready(function() { |
| 37 | + $(o).click(function() { |
| 38 | + setTimeout(addShareListener, 1000); |
| 39 | + }); |
13 | 40 | }); |
14 | 41 | } |
15 | 42 |
|
|
0 commit comments