Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
marka
Commits
9b825305
Commit
9b825305
authored
Jan 28, 2016
by
Smari McCarthy
Browse files
Fixed moving back to original
parent
799207b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
css/marka.css
css/marka.css
+4
-3
js/marka.js
js/marka.js
+7
-7
No files found.
css/marka.css
View file @
9b825305
...
...
@@ -5,7 +5,7 @@
.marka
>
.marka-dropdown
{
visibility
:
hidden
;
opacity
:
0
;
}
.marka
>
.marka-dropdown
>
.marka-result
{
display
:
block
;
...
...
@@ -31,6 +31,7 @@
color
:
#8C9566
;
text-shadow
:
0px
0px
1px
#34AE30
;
white-space
:
nowrap
;
display
:
block
;
}
.marka-dropdown
::after
{
...
...
@@ -43,7 +44,7 @@
.marka-dropdown
::before
{
content
:
"in original currency:"
;
}
.marka-dropdown
:empty::before
{
...
...
@@ -145,4 +146,4 @@
#marka-currency-lightbox
#marka-currency-select
option
[
value
=
""
]
{
margin-bottom
:
1em
}
\ No newline at end of file
}
js/marka.js
View file @
9b825305
...
...
@@ -94,9 +94,6 @@ Marka.prototype.match = function() {
Marka
.
prototype
.
doConversions
=
function
()
{
var
self
=
this
;
if
(
this
.
getCurrentCurrency
()
==
""
||
this
.
getCurrentCurrency
()
==
null
)
{
return
;
}
$
(
"
.marka
"
).
each
(
function
(
index
,
value
)
{
var
text
=
$
(
value
).
data
(
"
original_value
"
);
var
res
=
self
.
splitSymbols
(
text
);
...
...
@@ -106,13 +103,15 @@ Marka.prototype.doConversions = function() {
var
node
=
$
(
value
);
var
children
=
node
.
children
()
self
.
getValueInSetCurrency
(
res
.
number
,
res
.
symbol
,
function
(
value
,
converted
)
{
if
(
converted
)
{
if
(
converted
==
true
)
{
node
.
html
(
value
.
toFixed
(
0
)
+
"
"
+
self
.
getCurrentCurrency
()
+
"
"
);
node
.
append
(
children
);
node
.
children
(
"
.marka-dropdown
"
).
html
(
"
<span class=
\"
marka-result
\"
>
"
+
node
.
data
(
"
original_value
"
)
+
"
</span>
"
)
}
else
{
node
.
text
(
node
.
data
(
"
original_value
"
))
node
.
append
(
children
);
}
node
.
append
(
children
);
node
.
children
(
"
.marka-dropdown
"
).
html
(
"
<span class=
\"
marka-result
\"
>
"
+
node
.
data
(
"
original_value
"
)
+
"
</span>
"
)
})
}
});
...
...
@@ -201,7 +200,7 @@ Marka.prototype.findSymbol = function(text) {
}
Marka
.
prototype
.
wrapNode
=
function
()
{
var
markaDropdownHTML
=
$
(
'
<span class="marka"
><span class="marka-dropdown"
onclick="$(
\'
#marka-currency-lightbox
\'
).css(
\'
display
\'
,
\'
flex
\'
)"></span></span>
'
);
var
markaDropdownHTML
=
$
(
'
<span class="marka" onclick="$(
\'
#marka-currency-lightbox
\'
).css(
\'
display
\'
,
\'
flex
\'
)"
><span class="marka-dropdown"
></span></span>
'
);
return
markaDropdownHTML
.
get
(
0
);
}
...
...
@@ -212,6 +211,7 @@ Marka.prototype.getValueInSetCurrency = function(value, from_currency, callback)
Marka
.
prototype
.
getValueInCurrency
=
function
(
value
,
from_currency
,
to_currency
,
callback
){
if
(
!
to_currency
){
callback
(
value
,
false
);
return
;
}
this
.
retreiveExchangeRates
(
from_currency
,
to_currency
,
function
(
rate
){
...
...
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