Changeset 29225

Show
Ignore:
Timestamp:
21.08.2014 13:20:09 (5 years ago)
Author:
kjdon
Message:

send the build request if we have changes that are not metadata changes

Files:
1 modified

Legend:

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

    r29214 r29225  
    306306        { 
    307307            var section = changedElem.parentDiv.parentItem; 
    308             saveTransaction('{"operation":"setText", "text":"' + changedElem.innerHTML.replace(/"/g, "\\\"").replace(/&/g, "%26") + '", "collection":"' + section.collection + '", "oid":"' + section.nodeID + '"}'); 
     308            saveTransaction('{"operation":"setText", "text":"' + changedElem.innerHTML.replace(/"/g, "\\\"").replace(/&/g, "%26") + '", "collection":"' + section.collection + '", "oid":"' + section.nodeID + '"}'); //' 
    309309            addCollectionToBuild(section.collection); 
    310310        } 
     
    313313            var id = changedElem.getAttribute("id"); 
    314314            var sectionID = id.substring(4); 
    315             saveTransaction('{"operation":"setText", "text":"' + changedElem.innerHTML.replace(/"/g, "\\\"").replace(/&/g, "%26") + '", "collection":"' + gs.cgiParams.c + '", "oid":"' + sectionID + '"}'); 
     315            saveTransaction('{"operation":"setText", "text":"' + changedElem.innerHTML.replace(/"/g, "\\\"").replace(/&/g, "%26") + '", "collection":"' + gs.cgiParams.c + '", "oid":"' + sectionID + '"}'); //' 
    316316            addCollectionToBuild(gs.cgiParams.c); 
    317317        } 
     
    346346        } 
    347347    } 
    348     processChangesLoop(0); 
     348    if (metadataChanges.length>0) { 
     349      // this will process each change one by one, and then send the build request 
     350      processChangesLoop(0); 
     351    } 
     352    else if(_collectionsToBuild.length > 0) { 
     353      // if there are no metadata changes, but some other changes eg text have happened, then we need to send the build request. 
     354      sendBuildRequest(); 
     355    } 
     356       
     357    /* need to clear the changes from the page so that we don't process them again next time */ 
     358    de.Changes.clear(); 
     359    while (_deletedMetadata.length>0) { 
     360      _deletedMetadata.pop(); 
     361    } 
    349362 
    350363}