Commit 5db315be by clrux

Merge pull request #12371 from edx/clrux/ac-405

AC-405 calculator image to icon
parents f0b33e33 cb19cdd2
...@@ -51,6 +51,7 @@ class @Calculator ...@@ -51,6 +51,7 @@ class @Calculator
$calcWrapper = $('#calculator_wrapper') $calcWrapper = $('#calculator_wrapper')
text = gettext('Open Calculator') text = gettext('Open Calculator')
isExpanded = false isExpanded = false
icon = 'fa-calculator'
$('div.calc-main').toggleClass 'open' $('div.calc-main').toggleClass 'open'
if $calc.hasClass('closed') if $calc.hasClass('closed')
...@@ -59,6 +60,7 @@ class @Calculator ...@@ -59,6 +60,7 @@ class @Calculator
.attr 'tabindex', -1 .attr 'tabindex', -1
else else
text = gettext('Close Calculator') text = gettext('Close Calculator')
icon = 'fa-close'
isExpanded = true isExpanded = true
$calcWrapper $calcWrapper
...@@ -74,6 +76,12 @@ class @Calculator ...@@ -74,6 +76,12 @@ class @Calculator
'title': text 'title': text
'aria-expanded': isExpanded 'aria-expanded': isExpanded
.find('.utility-control-label').text text .find('.utility-control-label').text text
$calc
.find('.icon')
.removeClass('fa-calculator')
.removeClass('fa-close')
.addClass(icon)
$calc.toggleClass 'closed' $calc.toggleClass 'closed'
......
...@@ -17,23 +17,20 @@ ...@@ -17,23 +17,20 @@
.calc { .calc {
@include transition(background-color $tmg-f2 ease-in-out 0s); @include transition(background-color $tmg-f2 ease-in-out 0s);
background: url("#{$static-path}/images/calc-icon.png") $black-t1 no-repeat center; @include float(right);
border-bottom: 0; @include right($baseline*.75);
color: $white;
float: right;
height: $baseline;
margin-right: ($baseline*0.75);
padding: $baseline;
position: relative; position: relative;
top: -42px; top: -42px;
width: ($baseline*0.75); border-bottom: 0;
padding: ($baseline/1.5);
background: $black-t1;
color: $white;
&:hover, &:focus { &:hover, &:focus {
background: url("#{$static-path}/images/calc-icon.png") $gray-d1 no-repeat center; background: $gray-d1;
} }
&.closed { &.closed {
background-image: url("#{$static-path}/images/close-calc-icon.png");
background-color: $black; background-color: $black;
top: -36px; top: -36px;
} }
......
...@@ -5,6 +5,7 @@ from django.core.urlresolvers import reverse ...@@ -5,6 +5,7 @@ from django.core.urlresolvers import reverse
<div class="calc-main"> <div class="calc-main">
<button title="${_('Open Calculator')}" aria-controls="calculator_wrapper" aria-expanded="false" class="calc utility-control-button"> <button title="${_('Open Calculator')}" aria-controls="calculator_wrapper" aria-expanded="false" class="calc utility-control-button">
<span class="icon fa fa-calculator" aria-hidden="true"></span>
<span class="utility-control-label sr">${_("Open Calculator")}</span> <span class="utility-control-label sr">${_("Open Calculator")}</span>
</button> </button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment