Project

General

Profile

« Previous | Next » 

Revision 53c705d4

Added by Andreas Kohlbecker over 7 years ago

ref #5956 improving classification breadcrumb navigation

  • avoiding boxes that are not being closed on mouse out third part

View differences:

modules/cdm_dataportal/includes/pages.inc
1040 1040
    $items[] = '<span>'
1041 1041
      . $more_children_icon . '&nbsp;' .
1042 1042
      '<span class="taxonomic-children-button" data-classification-uuid="' . $current_classification_uuid
1043
      . '" data-rank-limit-uuid="' . $rank_limit_uuid . '" > ' . $more_children_label . '<span>'
1043
      . '" data-rank-limit-uuid="' . $rank_limit_uuid . '" data-cdm-align-with="prev"> ' . $more_children_label . '<span>'
1044 1044
      . '</span>';
1045 1045
  } else if($more_children_for){
1046 1046
    // last parent item has child taxon nodes
1047 1047
    $items[] = ' <span>'
1048 1048
      . $more_children_icon . '&nbsp;' .
1049 1049
      '<span class="taxonomic-children-button" data-cdm-taxon-uuid="' .$more_children_for
1050
      . '" data-cdm-classification-mode="children" >' . $more_children_label . '</span>'
1050
      . '" data-cdm-classification-mode="children" data-cdm-align-with="prev"> ' . $more_children_label . '</span>'
1051 1051
      . '</span>';
1052 1052

  
1053 1053
  }
modules/cdm_dataportal/js/jquery.cdm.taxonomic_children.js
314 314
        this.container.show();
315 315
        this.adjustHeightAndMaxWidth();
316 316
        this.scrollToSelected();
317
        this.checkMouseOver();
317

  
318
        // data loading may take quite long
319
        // need to check asynchronously if the
320
        // mouse still is hovering
321
        var this_plugin = this;
322
        setTimeout(function() {
323
          this_plugin.checkMouseOver();
324
        },
325
        300);
326

  
318 327
      }
319 328

  
320 329
      this.$element.prev('i').attr('class', this.icon_class_attr);
......
432 441
      return request;
433 442
    },
434 443

  
435
    monitorMouseOver: function() {
436
      while(this.container.delay(100).is(':visible')){
437
        this.checkMouseOver();
438
      }
439
    },
440

  
441 444
    checkMouseOver: function(){
442
      if(this.container.find(':hover').length == 0){
445
      // see http://stackoverflow.com/questions/6035137/jquery-check-hover-status-before-start-trigger/6035278#6035278
446
      //
447
      // this.container.find(':hover').length == 0
448
      // is(':hover')
449
      //this.log('>>>> hover: ' + this.container.find(':hover').length + ' | ' +  this.container.is(':hover') );
450
      if(!this.container.is(':hover')){
443 451
        this.hideChildren();
444 452
      }
445 453
    }

Also available in: Unified diff