Commit 9b825305 authored by Smari McCarthy's avatar Smari McCarthy
Browse files

Fixed moving back to original

parent 799207b0
......@@ -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
}
......@@ -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){
......
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