Project

General

Profile

« Previous | Next » 

Revision 7a2a14b3

Added by Andreas Kohlbecker over 11 years ago

fixing #3217 (specimens: rename label type into 'Basis of record') and solving a lot of problems like recursive page loading du to a bug in ahah-content.js and type in cdm service call, ...

View differences:

7.x/modules/cdm_dataportal/js/ahah-content.js
5 5

  
6 6
(Drupal.ahahContentAutoAttach = (function ($) {
7 7

  
8
    $(".ahah-content").each(function(i){
9
      
10
      var ahahContent = $(this);
11
      url = ahahContent.attr("rel");
12
      ahahContent.removeAttr('rel').find('.loading').css('display', 'block');
8
	// firebug console stub (avoids errors if firebug is not active)
9
	if(typeof console === "undefined") {
10
	    console = { log: function() { } };
11
	}
13 12

  
14
      $.get(url, function(html){
15
        ahahContent.find('.loading').remove();
16
        ahahContent.append(html);
17
        });
13
  // register with all elements .ahah-content
14
    $(".ahah-content").each(function(index, element) {
15
      var ahahContent = $(element);
16
      url = ahahContent.attr("rel");
17
      console.log("ahah-content url:" + url);
18
      if(url !== undefined && url.length > 1){
19
//        ahahContent.removeAttr('rel').find('.loading').css('display', 'block');
20
        ahahContent.find('.loading').css('display', 'block');
21
        $.get(url, function(html){
22
          ahahContent.find('.loading').remove();
23
          ahahContent.append(html);
24
          });
25
        }
18 26
      });
19
    
27

  
20 28
      // register with lightbox etc ...
21 29
      $('body').bind('overflow', function(event){
22
        
30

  
23 31
        var ahah_content_set = $(event.target).find('.ahah-content');
24
        if(ahah_content_set != undefined){
32
        if(ahah_content_set !== undefined){
25 33
          $(ahah_content_set).each(function(i){
26 34
            var ahah_content = $(this);
27 35
            var url = ahah_content.attr('rel');
28
            if(url != undefined){
36
            console.log("ahah-content on 'overflow' url:" + url);
37
            if(url !== undefined && url.length > 1){
29 38
              ahah_content.removeAttr('rel').find('.loading').css('display', 'block');
30 39
              $.get(url, function(html){
31 40
                ahah_content.find('.loading').remove().end().append(html);
32 41
                });
33 42
            }
34
          })
35
          
43
          });
44

  
36 45
        }
37 46
      });
38
      
39
    }))(jQuery)
40
  
47

  
48
    }))(jQuery);
49

  
41 50

  
42 51

  
43
  jQuery(document).ready(Drupal.ahahContentAutoAttach);
52
jQuery(document).ready(Drupal.ahahContentAutoAttach);

Also available in: Unified diff