Changeset 6754


Ignore:
Timestamp:
Feb 20, 2015, 11:27:08 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1325: Lists of items (similar funcion as biomaterial lists)

Options in selection lists with html tags are now handled betted. The html is removed when displaying the filter summary and click event handler now use the correct target element.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/include/scripts/main-2.js

    r6742 r6754  
    36053605      {
    36063606        keys[keys.length] = option.key;
    3607         values[values.length] = option.value;
     3607        var ii = option.value.indexOf('<');
     3608        values[values.length] = ii < 0 ? option.value : option.value.substring(0, ii).trim();
    36083609      }
    36093610    }
     
    38043805    var allOptionsDiv = document.createElement('div');
    38053806    allOptionsDiv.className = 'multioptionoptions';
    3806     Events.addEventHandler(allOptionsDiv, 'click', internal.optionOnClick);
    3807     Events.addEventHandler(allOptionsDiv, 'mouseover', internal.optionHighlight);
    38083807   
    38093808    for (var i = 0; i < options.length; i++)
     
    38153814      options[i].div = optionDiv;
    38163815      allOptionsDiv.appendChild(optionDiv);
     3816      Events.addEventHandler(optionDiv, 'click', internal.optionOnClick);
     3817      Events.addEventHandler(optionDiv, 'mouseover', internal.optionHighlight);
    38173818    }
    38183819   
     
    39503951  internal.optionOnClick = function(event)
    39513952  {
    3952     var option = event.target;
     3953    var option = event.currentTarget;
    39533954    select.toggleOption(option);
    39543955  }
     
    39603961  internal.optionHighlight = function(event)
    39613962  {
    3962     var option = event.target;
     3963    var option = event.currentTarget;
    39633964    select.highlightOption(option);
    39643965  }
Note: See TracChangeset for help on using the changeset viewer.