Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5ca6bfeb
Commit
5ca6bfeb
authored
Jun 25, 2015
by
Peter Fogg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8668 from edx/peter-fogg/update-team-tab-urls
Update URL when switching between Team tabs.
parents
4662246b
e6c7a571
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
lms/static/js/components/tabbed/views/tabbed_view.js
+3
-1
lms/static/js/spec/components/tabbed/tabbed_view_spec.js
+5
-0
No files found.
lms/static/js/components/tabbed/views/tabbed_view.js
View file @
5ca6bfeb
...
...
@@ -41,12 +41,14 @@
},
setActiveTab
:
function
(
index
)
{
var
tab
=
this
.
tabs
[
index
],
view
=
tab
.
view
;
this
.
$
(
'a.is-active'
).
removeClass
(
'is-active'
).
attr
(
'aria-selected'
,
'false'
);
this
.
$
(
'a[data-index='
+
index
+
']'
).
addClass
(
'is-active'
).
attr
(
'aria-selected'
,
'true'
);
var
view
=
this
.
tabs
[
index
].
view
;
view
.
render
();
this
.
$
(
'.page-content-main'
).
html
(
view
.
$el
.
html
());
this
.
$
(
'.sr-is-focusable'
).
focus
();
this
.
router
.
navigate
(
tab
.
url
,
{
replace
:
true
});
},
switchTab
:
function
(
event
)
{
...
...
lms/static/js/spec/components/tabbed/tabbed_view_spec.js
View file @
5ca6bfeb
...
...
@@ -72,6 +72,11 @@
expect
(
view
.
$
(
'.nav-item[data-index=0]'
)).
toHaveAttr
(
'aria-selected'
,
'false'
);
expect
(
view
.
$
(
'.nav-item[data-index=1]'
)).
toHaveAttr
(
'aria-selected'
,
'true'
);
});
it
(
'updates the page URL on tab switches without adding to browser history'
,
function
()
{
view
.
$
(
'.nav-item[data-index=1]'
).
click
();
expect
(
Backbone
.
history
.
navigate
).
toHaveBeenCalledWith
(
'test 2'
,
{
replace
:
true
});
});
});
}
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment