PluginProbe
Property Hive / 2.2.6
Property Hive v2.2.6
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / assets / js / admin / recently-viewed.js

recently-viewed.js in Property Hive 2.2.6, at assets/js/admin/recently-viewed.js

35 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery( function ( $ ) {
2
3 if ($('#contextual-help-link-wrap .show-recently-viewed').length == 0)
4 {
5 $("#screen-meta-links").append('<div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle" style="z-index:2;"><button class="show-settings show-recently-viewed" style="cursor:pointer">Recently Viewed</button></div>');
6
7 var html = '';
8
9 if ( Object.keys(propertyhive_admin_recently_viewed.recently_viewed).length > 0 )
10 {
11 html += '<ul>';
12 for ( var i in propertyhive_admin_recently_viewed.recently_viewed )
13 {
14 html += '<li><a href="' + propertyhive_admin_recently_viewed.recently_viewed[i].edit_link + '">' + propertyhive_admin_recently_viewed.recently_viewed[i].title + '</a></li>';
15 }
16 html += '</ul>';
17 }
18 else
19 {
20 html += '<div class="none">No recently viewed items to display</div>';
21 }
22
23 $("#screen-meta-links").append('<div class="ph-recently-viewed-popup">' + html + '</div>');
24
25 $('body').on('click', '#contextual-help-link-wrap .show-recently-viewed', function(e)
26 {
27 e.preventDefault();
28
29 jQuery('.ph-recently-viewed-popup').css({
30 top: $(this).position().top + $(this).outerHeight(),
31 right: $(document).width() - ($(this).parent().offset().left + $(this).parent().outerWidth())
32 }).fadeToggle('fast');
33 });
34 }
35 });