source: extensions/greydragon/trunk/js/theme.photo.js @ 30212

Last change on this file since 30212 was 30210, checked in by SergeD, 10 years ago

version 1.0.13
+ New colorpack - GreyDragon
+ ADMIN: Added support for horizontal menu - "Static Menu - Header Bottom". When used with Additional Pages Plugin, pages except Root Page would be embeded

into menu bar instead of drop down menu.

+ ADMIN: Added option "Display navigation arrows" for Root page
+ ADMIN: Added option "Display navigation controls" for Root page
+ Added support for thumb shadow space - custom CSS is required (please refer to help section in admin area). Latest gdThumb is recomended.
+ CSS: cleanup

  • Removed hardcoded height for root page slideshow to accomodate navigation controls
  • Fixed issues with Categories List overlapping when Static menu is enabled
  • In Phote page, hide overflow photo when huge size is used
  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1(function() {
2
3  function setCurrentTab() {
4    $(".image-metadata-tab").hide();
5    var cur_tab = window.location.hash;
6    if (cur_tab) {} else { cur_tab = "#" + $(".image-metadata li.active").attr("rel"); }
7    if (cur_tab !== "#undefined") {
8      if ((cur_tab == '#comments') || (cur_tab == '#edit_comment')) { cur_tab = "#tab-comment"; }
9      var cur_tab_rel = cur_tab.replace("#", "");
10      $("ul.image-metadata li").removeClass("active");
11      $("ul.image-metadata li[rel='" + cur_tab_rel + "']").addClass("active");
12      if (cur_tab == "#tab-comment") { normalizeComments("tab-comment"); }
13      $(cur_tab).show();
14    } else {
15      $(".image-metadata-tab").first().show(); 
16    }
17  }
18
19  function normalizeComments(activeTab) {
20    if (activeTab == 'tab-comment') {
21      $("li.commentElement .actions a").each(function( index ) {
22        if ($(this).is('a[href*="#"]')) { 
23        } else {
24          var href = $(this).attr("href") + "#tab-comment";
25          $(this).attr("href", href);
26        }
27      });
28    }
29  }
30
31  function switchTab(tab) {
32    $("ul.image-metadata li").removeClass("active");
33    $(tab).addClass("active");
34    $(".image-metadata-tab").hide();
35    var activeTab = $(tab).attr("rel"); 
36    window.location.hash = '#' + activeTab;
37    if (p_pict_tab_anim == "on") {
38      $("#" + activeTab).fadeIn();
39    }else{
40      $("#" + activeTab).show();
41    }
42    normalizeComments(activeTab);
43  }
44
45  jQuery(function(){
46    setCurrentTab();
47
48    $("ul.image-metadata li").click(function() { switchTab(this); });
49  });
50}());
Note: See TracBrowser for help on using the repository browser.