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
0d2e2660
Commit
0d2e2660
authored
Apr 23, 2015
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding hover state to image profile for accessibility.
TNL-2051
parent
d60b4eed
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
7 deletions
+40
-7
lms/static/js/student_profile/views/learner_profile_fields.js
+2
-0
lms/static/js/views/fields.js
+14
-2
lms/static/sass/base/_mixins.scss
+6
-0
lms/static/sass/views/_learner-profile.scss
+17
-5
lms/templates/fields/field_image.underscore
+1
-0
No files found.
lms/static/js/student_profile/views/learner_profile_fields.js
View file @
0d2e2660
...
...
@@ -44,6 +44,8 @@
LearnerProfileFieldViews
.
ProfileImageFieldView
=
FieldViews
.
ImageFieldView
.
extend
({
screenReaderTitle
:
gettext
(
'Profile Image'
),
imageUrl
:
function
()
{
return
this
.
model
.
profileImageUrl
();
},
...
...
lms/static/js/views/fields.js
View file @
0d2e2660
...
...
@@ -561,6 +561,7 @@
titleRemoving
:
gettext
(
"Removing"
),
titleImageAlt
:
''
,
screenReaderTitle
:
gettext
(
"Image"
),
iconUpload
:
'<i class="icon fa fa-camera" aria-hidden="true"></i>'
,
iconRemove
:
'<i class="icon fa fa-remove" aria-hidden="true"></i>'
,
...
...
@@ -571,7 +572,9 @@
events
:
{
'click .u-field-upload-button'
:
'clickedUploadButton'
,
'click .u-field-remove-button'
:
'clickedRemoveButton'
,
'click .upload-submit'
:
'clickedUploadButton'
'click .upload-submit'
:
'clickedUploadButton'
,
'focus .upload-button-input'
:
'showHoverState'
,
'blur .upload-button-input'
:
'hideHoverState'
},
initialize
:
function
(
options
)
{
...
...
@@ -589,7 +592,8 @@
uploadButtonIcon
:
_
.
result
(
this
,
'iconUpload'
),
uploadButtonTitle
:
_
.
result
(
this
,
'uploadButtonTitle'
),
removeButtonIcon
:
_
.
result
(
this
,
'iconRemove'
),
removeButtonTitle
:
_
.
result
(
this
,
'removeButtonTitle'
)
removeButtonTitle
:
_
.
result
(
this
,
'removeButtonTitle'
),
screenReaderTitle
:
_
.
result
(
this
,
'screenReaderTitle'
)
}));
this
.
delegateEvents
();
this
.
updateButtonsVisibility
();
...
...
@@ -597,6 +601,14 @@
return
this
;
},
showHoverState
:
function
()
{
this
.
$
(
'.u-field-upload-button'
).
addClass
(
'button-visible'
);
},
hideHoverState
:
function
()
{
this
.
$
(
'.u-field-upload-button'
).
removeClass
(
'button-visible'
);
},
showErrorMessage
:
function
(
message
)
{
return
message
;
},
...
...
lms/static/sass/base/_mixins.scss
View file @
0d2e2660
...
...
@@ -37,6 +37,12 @@
display
:
block
;
}
@mixin
show-hover-state
()
{
opacity
:
1
;
background-color
:
$shadow-d2
;
border-radius
:
(
$baseline
/
4
);
}
@function
em
(
$pxval
,
$base
:
16
)
{
@return
#{
$pxval
/
$base
}
em
;
}
...
...
lms/static/sass/views/_learner-profile.scss
View file @
0d2e2660
...
...
@@ -58,6 +58,14 @@
i
{
color
:
$white
;
}
&
:focus
{
@include
show-hover-state
();
}
}
.button-visible
{
@include
show-hover-state
();
}
.upload-button-icon
,
.upload-button-title
{
...
...
@@ -88,17 +96,21 @@
margin-top
:
2px
;
text-align
:
center
;
&
:
focus
,
&
:
active
{
&
:active
{
box-shadow
:
none
;
outline
:
0
;
}
&
:focus
{
@include
show-hover-state
();
box-shadow
:
none
;
outline
:
0
;
border
:
2px
dashed
$link-color
!
important
;
}
}
&
:hover
{
&
:hover
,
&
:focus
{
.u-field-upload-button
,
.u-field-remove-button
{
opacity
:
1
;
background-color
:
$shadow-d2
;
border-radius
:
(
$baseline
/
4
);
@include
show-hover-state
();
}
}
}
...
...
lms/templates/fields/field_image.underscore
View file @
0d2e2660
...
...
@@ -11,6 +11,7 @@
<button class="u-field-remove-button" type="button">
<span class="remove-button-icon" aria-hidden="true"><%= removeButtonIcon %></span>
<span class="remove-button-title" aria-live="polite"><%= removeButtonTitle %></span>
<span class="sr"><%= screenReaderTitle %></span>
</button>
</div>
</div>
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