Project

General

Profile

« Previous | Next » 

Revision 24bff82e

Added by Andreas Kohlbecker almost 5 years ago

ref #8388 UTIS search block: better labels for providers

View differences:

modules/cdm_dataportal/js/utis-client/utis-client.js
12 12

  
13 13
  // Default options for the plugin as a simple object
14 14
  var defaults = {
15
    providers: ['bgbm-phycobank', 'diatombase', 'worms'],
15
    providers: {'bgbm-phycobank': 'PhycoBank', 'diatombase' : 'DiatomBase', 'worms': 'WoRMS'},
16 16
    // webserviceUrl : 'https://cybertaxonomy.eu/eu-bon/utis/1.3',
17 17
    webserviceUrl : 'http://test.e-taxonomy.eu/eubon-utis',
18 18
    pageSize: 20,
......
96 96
           style: 'display: inline-block; width:30%; vertical-align: top;'
97 97
        });
98 98
      var checkboxesArray = [];
99
      $.each(this.opts.providers, function (index, value) {
100
        var checkbox_id = 'checkbox_' + value;
99
      $.each(Object.keys(plugin.options.providers), function (index, key) {
100
        var checkbox_id = 'checkbox_' + key;
101 101
        var checkbox =   $("<input/>",
102 102
          {
103 103
            type: 'checkbox',
104 104
            name: 'provider',
105 105
            checked: index == 0 ? 'checked' : '',
106
            value: value,
106
            value: key,
107 107
            id:  checkbox_id
108 108
          }
109 109
        );
110
        var label = $('<label for="' + checkbox_id + '" style="display: inline-block; vertical-align: top;">&nbsp;' +  value + '</label><br/>');
110
        var label = $('<label for="' + checkbox_id + '" style="display: inline-block; vertical-align: top;">&nbsp;' +  plugin.options.providers[key] + '</label><br/>');
111 111
        // label.append(checkbox);
112 112
        checkBoxesDiv.append(checkbox).append(label);
113 113

  

Also available in: Unified diff