Changeset 29174

Show
Ignore:
Timestamp:
07.08.2014 13:08:13 (5 years ago)
Author:
kjdon
Message:

new function addMetaSetTolist so that other places can call this - eg when making a fixed list of sets rather than a dynamic one

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/documentmaker_scripts_util.js

    r29110 r29174  
    66var COMPLETED = 11; 
    77var HALTED = 12; 
     8 
    89 
    910function getElementsByClassName(cl, parent)  
     
    685686} 
    686687 
     688function addMetaSetToList(list, set, selected) { 
     689  var newOption = $("<option>"); 
     690  newOption.html(set); 
     691  if (selected) { 
     692    newOption.attr("selected", true); 
     693  } 
     694  list.append(newOption); 
     695} 
     696 
    687697function addFunctionalityToTable(table) 
    688698{ 
     
    692702        var metadataName = $(cells[0]).html(); 
    693703         
    694         if(metadataName.indexOf(".") != -1) 
     704        if(dynamic_metadata_list == true && metadataName.indexOf(".") != -1) 
    695705        { 
    696706            var metadataSetName = metadataName.substring(0, metadataName.lastIndexOf(".")); 
     
    709719            { 
    710720                _metadataSetList.push(metadataSetName); 
    711                  
    712                 var metadataSetList = $("#metadataSetList"); 
    713                 var newOption = $("<option>"); 
    714                 newOption.html(metadataSetName); 
    715                 metadataSetList.append(newOption); 
     721                addMetaSetToList( $("#metadataSetList"), metadataSetName); 
    716722            } 
    717723        } 
     
    781787} 
    782788 
     789/* This is for 'edit structure' menu bar */ 
    783790function createTopMenuBar() 
    784791{