Occasionally it is useful to replace the standard functionality of an ExtraView inbuilt JavaScript function with a user-defined JavaScript function. You can use JavaScript's ability to return a Boolean answer in response to a query on the existence of a method. As an example, you may want to override the inbuilt ExtraView JavaScript function named SubmitChange. This method lives within a JavaScript file that is accessed from the Add Issue screen, named AddEdit.js.
/** * this will call the _userSubmitChange if * it is defined, else it calls submitChange */ function userSubmitChange(field){ if(_userSubmitChange){ _userSubmitChange(field); } else { submitChange(field); } }
If the function _userSubmitChange doesn't exist in the UserJavaScript.js file, then the standard submitChange function is used instead. Its existence is assured as it is contained in the standard ExtraView distribution file.