Changeset 6722b7
- Timestamp:
- Nov 28, 2012, 9:53:13 AM (10 years ago)
- Branches:
- ng_0.9
- Children:
- 49c74e
- Parents:
- 8aa4c2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
content/vI_storage.js
r8aa4c2 r6722b7 65 65 Log.debug("awSetInputAndPopupValue '" + inputElem.id + "'"); 66 66 storage.original_functions.awSetInputAndPopupValue(inputElem, inputValue, popupElem, popupValue, rowNumber); 67 storage.updateVIdentityFromStorage(inputElem );67 storage.updateVIdentityFromStorage(inputElem, document); 68 68 } 69 69 }, … … 73 73 if (!element || ! element.id.match(/^addressCol2*/)) return; 74 74 Log.debug("awOnBlur '" + element.id + "'"); 75 storage.updateVIdentityFromStorage(element );75 storage.updateVIdentityFromStorage(element, document); 76 76 storage.focusedElement = null; 77 77 }, … … 84 84 awPopupOnCommand : function (element) { 85 85 Log.debug("awPopupOnCommand '" + element.id + "'"); 86 storage.updateVIdentityFromStorage(document.getElementById(element.id.replace(/^addressCol1/,"addressCol2")) );86 storage.updateVIdentityFromStorage(document.getElementById(element.id.replace(/^addressCol1/,"addressCol2")), document); 87 87 if (element.selectedItem.getAttribute("value") == "addr_reply") // if reply-to is manually entered disable AutoReplyToSelf 88 88 document.getElementById("virtualIdentityExtension_autoReplyToSelfLabel").setAttribute("hidden", "true"); … … 145 145 146 146 firstUsedInputElement : null, // this stores the first Element for which a Lookup in the Storage was successfull 147 updateVIdentityFromStorage: function(inputElement ) {147 updateVIdentityFromStorage: function(inputElement, refdocument) { 148 148 if (!vI.vIprefs.get("storage")) 149 149 { Log.debug("Storage deactivated"); return; } 150 150 Log.debug("updateVIdentityFromStorage()"); 151 // error: document is null in following line -- XXXXXXXXX 152 try {153 var recipientType =document.getElementById(inputElement.id.replace(/^addressCol2/,"addressCol1"))151 Log.debug(refdocument); 152 Log.debug(refdocument.id); 153 var recipientType = refdocument.getElementById(inputElement.id.replace(/^addressCol2/,"addressCol1")) 154 154 .selectedItem.getAttribute("value"); 155 } 156 catch(e) { 157 Log.debug("#### something went wrong, document seems to be null\n"); 158 Log.debug("inputElement.id " + inputElement.id); 159 return; 160 } 161 var row = inputElement.id.replace(/^addressCol2#/,"") 155 156 var row = inputElement.id.replace(/^addressCol2#/,"") 162 157 if (recipientType == "addr_reply" || recipientType == "addr_followup" || storage.__isDoBcc(row)) { 163 158 // reset firstUsedInputElement if recipientType was changed (and don't care about doBcc fields) … … 180 175 // firstUsedInputElement was set before and we are not editing the same 181 176 var isNotFirstInputElement = (storage.firstUsedInputElement && storage.firstUsedInputElement != inputElement) 182 var currentIdentity = document.getElementById("virtualIdentityExtension_msgIdentityClone").identityData177 var currentIdentity = refdocument.getElementById("virtualIdentityExtension_msgIdentityClone").identityData 183 178 var storageResult = storage._rdfDatasourceAccess.updateVIdentityFromStorage(inputElement.value, recipientType, 184 currentIdentity, document.getElementById("virtualIdentityExtension_msgIdentityClone").vid, isNotFirstInputElement, window);179 currentIdentity, refdocument.getElementById("virtualIdentityExtension_msgIdentityClone").vid, isNotFirstInputElement, window); 185 180 186 181 if (storageResult.identityCollection.number == 0) return; // return if there was no match … … 193 188 for (var j = 0; j < storageResult.identityCollection.number; j++) { 194 189 Log.debug("updateVIdentityFromStorage adding: " + storageResult.identityCollection.identityDataCollection[j].combinedName); 195 let menuItem = document.getElementById("virtualIdentityExtension_msgIdentityClone")190 let menuItem = refdocument.getElementById("virtualIdentityExtension_msgIdentityClone") 196 191 .addIdentityToCloneMenu(storageResult.identityCollection.identityDataCollection[j]) 197 192 if (!newMenuItem) newMenuItem = menuItem; … … 200 195 if (storageResult.result == "accept") { 201 196 Log.debug("updateVIdentityFromStorage selecting: " + storageResult.identityCollection.identityDataCollection[0].combinedName); 202 document.getElementById("virtualIdentityExtension_msgIdentityClone").selectedMenuItem = newMenuItem;203 if ( document.getElementById("virtualIdentityExtension_msgIdentityClone").vid)197 refdocument.getElementById("virtualIdentityExtension_msgIdentityClone").selectedMenuItem = newMenuItem; 198 if (refdocument.getElementById("virtualIdentityExtension_msgIdentityClone").vid) 204 199 vI.StorageNotification.info(storage.stringBundle.GetStringFromName("vident.smartIdentity.vIStorageUsage") + "."); 205 200 } … … 207 202 208 203 __isDoBcc : function(row) { 209 var recipientType = awGetPopupElement(row).selectedItem.getAttribute("value");204 var recipientType = storage.awGetPopupElement(row).selectedItem.getAttribute("value"); 210 205 if (recipientType != "addr_bcc" || !getCurrentIdentity().doBcc) return false 211 206 … … 213 208 214 209 for (var index = 0; index < doBccArray.count; index++ ) { 215 if (doBccArray.StringAt(index) == awGetInputElement(row).value) {210 if (doBccArray.StringAt(index) == storage.awGetInputElement(row).value) { 216 211 Log.debug("ignoring doBcc field '" + 217 212 doBccArray.StringAt(index));
Note: See TracChangeset
for help on using the changeset viewer.