aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bzpage.js32
1 files changed, 21 insertions, 11 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 997ac5b..d9d679d 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -90,8 +90,11 @@ var BZPage = function BZPage(win, config) {
this.CCList = this.getCCList();
// Prepare for query buttons
- // TODO getting null for commentArea sometimes
- var commentArea = this.doc.getElementById("comment_status_commit");
+ // element ID brElementPlace_location is later used in JSON files
+ // Stay with this add_comment element even if RH BZ upgrades, this seems
+ // to be generally much more stable (even with other bugzillas, e.g. b.gnome.org)
+ // then some getElementById.
+ var commentArea = this.doc.getElementsByName("add_comment")[0].parentNode;
if (commentArea) {
var brElementPlacer = commentArea.getElementsByTagName("br");
brElementPlacer = brElementPlacer[0];
@@ -265,14 +268,19 @@ BZPage.prototype.executeCommand = function executeCommand (cmd) {
};
/**
- * Add XGL to the CC list
+ * Change assignee of the bug
*
- * @param evt Event which made this function active
+ * @param newAssignee String with the email address of new assigneeAElement
+ * or 'default' if the component's default assignee should be used.
+ * Value null clears "Reset Assignee to default for component" checkbox
* @return none
*/
BZPage.prototype.changeAssignee = function changeAssignee (newAssignee) {
var defAssigneeButton = null;
+ // Previous assignee should know what's going on in his bug
this.addToCCList(this.owner);
+
+ // Optional value null
if (newAssignee === null) {
this.doc.getElementById("set_default_assignee").removeAttribute(
"checked");
@@ -502,12 +510,17 @@ BZPage.prototype.collectComments = function collectComments () {
* @return none
*
*/
-BZPage.prototype.selectOption = function selectOption (id, label) {
+BZPage.prototype.selectOption = function selectOption (id, label, fireEvent) {
+ if (fireEvent === null) {
+ fireEvent = true;
+ }
var sel = this.doc.getElementById(id);
sel.value = label;
- var intEvent = this.doc.createEvent("HTMLEvents");
- intEvent.initEvent("change", true, true);
- sel.dispatchEvent(intEvent);
+ if (fireEvent) {
+ var intEvent = this.doc.createEvent("HTMLEvents");
+ intEvent.initEvent("change", true, true);
+ sel.dispatchEvent(intEvent);
+ }
};
/**
@@ -693,9 +706,6 @@ BZPage.prototype.setUpLogging = function setUpLogging () {
var that = this;
// logging all submits for timesheet
- // TODO we should merge in functionality of RHBugzillaPage.submitCallback
- // and actually make it working
- // Maybe rewriting whole offline capability into a separate object?
if (!this.submitHandlerInstalled) {
console.log("Installing submit callback!");
this.doc.forms.namedItem("changeform").addEventListener("submit",function (evt) {