Projet

Général

Profil

Paste
Télécharger (833 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / sweaver / plugins / sweaver_plugin_themeclasses / sweaver_plugin_themeclasses.js @ 651307cd

1

    
2
(function ($) {
3

    
4
/**
5
 * See if the classes are found on the page.
6
 */
7
$(document).ready(function() {
8
  $('#sweaver_plugin_themeclasses .sweaver-switch-to-style').each(function() {
9
    var className = $(this).attr('id').replace('spt-', '');
10
    if ($('.'+ className).length == 0) {
11
      $(this).hide();
12
    }
13
  });
14
});
15

    
16
/**
17
 * Switch to style editor and start editing the class.
18
 */
19

    
20
Drupal.Sweaver.ThemeClasses = function(class_name, class_label) {
21

    
22
  // Switch tabs.
23
  var remove_tab = 'tab-sweaver_plugin_themeclasses';
24
  var show_tab = 'tab-sweaver_plugin_editor';
25
  Drupal.Sweaver.switchTab(remove_tab, show_tab);
26

    
27
  // Update the values for the Style tab.
28
  class_name = class_name.replace('spt-', '');
29
  class_label = class_label.replace('spt-', '');  
30
  Drupal.Sweaver.updateStyleTab(class_name, class_label);
31
}
32

    
33
})(jQuery);