Opened 15 years ago

Closed 15 years ago

#235 closed defect (fixed)

Task Pane's home button sometimes directs to a task instead of the home page

Reported by: dorshemer Owned by: madair
Priority: P2 Milestone: 2.0
Component: Widgets Version: 1.1.1
Severity: Minor Keywords: "Task Pane" Home
Cc: Browser: All
External ID: Operating System: All
state: New

Description

  1. Select a task on the Task List menu
  2. Click the Task Pane Home button
  3. Select a task again
  4. Click the Home button

After the fourth step, the task pane will reload with the last task it had, instead of the task pane's home page.

This occurs because of the following code (widgets/TaskPane.js):

goHome: function() {
        this.nCurrentTask = 0;
        this.iframe.src = this.aExecutedTasks[this.nCurrentTask];
        this.updateButtons();
    },

setContent: function(url) {
        ....
                
        this.aExecutedTasks.push(url);
        ++this.nCurrentTask;
        this.iframe.src = url;
        this.iframe.taskPaneId = this.widgetTag.name;
        this.updateButtons();
    },

Selecting a task calls setContent which pushes the task URL to the aExecutedTasks array, but clicking the home button resets the array without pushing it. The next call to setContent will place the task URL at index 0, and every call to goHome after that will invoke that URL.

To fix it, I suggest calling setContent from goHome:

goHome: function() {
        this.nCurrentTask = 0;
	var url = this.aExecutedTasks[this.nCurrentTask];
	this.aExecutedTasks = [];
	this.setContent(url);
    },

or perhaps something more elegant.

Change History (1)

comment:1 by madair, 15 years ago

Milestone: Future2.0
Resolution: fixed
Status: newclosed

fixed at rev 1925

Note: See TracTickets for help on using tickets.