Opened 10 years ago

Closed 10 years ago

#10223 closed defect (worksforme)

adding new tab to tabContainer using javascript doesn't work

Reported by: vorun Owned by: anonymous
Priority: blocker Milestone: tbd
Component: Dijit Version: 1.4.0b
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

dijit.layout.ScrollingTabController?

The function below doesn't work because dojo.style(n, "width") below

_getScrollForSelectedTab: function(){
		// summary:
		//		Returns the scroll value setting so that the selected tab
		//		will appear in the center
		var w = this.scrollNode,
			n = this._selectedTab,
			scrollNodeWidth = dojo.style(this.scrollNode, "width"),
			scrollBounds = this._getScrollBounds();

		// TODO: scroll minimal amount (to either right or left) so that
		// selected tab is fully visible, and just return if it's already visible?
		var pos = (n.offsetLeft + dojo.style(n, "width")/2) - scrollNodeWidth/2;
		pos = Math.min(Math.max(pos, scrollBounds.min), scrollBounds.max);

		// TODO:
		// If scrolling close to the left side or right side, scroll
		// all the way to the left or right.  See this._minScroll.
		// (But need to make sure that doesn't scroll the tab out of view...)
		return pos;
	},

Change History (1)

comment:1 Changed 10 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Resolution: worksforme
Status: newclosed

test_TabContainer.html has a test for adding tabs and it seems to work fine.

As I've written in every single bug that you've filed, you need to supply a test case.

Note: See TracTickets for help on using tickets.