Adds size-equal and capitalizes currency text
This commit is contained in:
parent
7fb2792a1a
commit
f4b0b46067
4 changed files with 22 additions and 3 deletions
|
|
@ -2,7 +2,13 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @desc amount directive that can be used to display formatted financial values
|
* @desc amount directive that can be used to display formatted financial values
|
||||||
* @example <amount value="12.49382901" currency="BCH"></amount>
|
* size-equal attribute is optional, defaults to false.
|
||||||
|
* @example fee = {
|
||||||
|
* value: 12.49382901,
|
||||||
|
* currency: 'BCH'
|
||||||
|
* }
|
||||||
|
* @example <amount value="fee.value" currency="fee.currency"></amount>
|
||||||
|
* @example <amount value="fee.value" currency="fee.currency" size-equal="true"></amount>
|
||||||
*/
|
*/
|
||||||
angular.module('bitcoincom.directives')
|
angular.module('bitcoincom.directives')
|
||||||
.directive('amount', [
|
.directive('amount', [
|
||||||
|
|
@ -12,10 +18,13 @@ angular.module('bitcoincom.directives')
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
scope: {
|
scope: {
|
||||||
value: '=',
|
value: '=',
|
||||||
currency: '='
|
currency: '=',
|
||||||
|
sizeEqual: '='
|
||||||
},
|
},
|
||||||
templateUrl: 'views/includes/amount.html',
|
templateUrl: 'views/includes/amount.html',
|
||||||
controller: ['$scope', function($scope) {
|
controller: ['$scope', function($scope) {
|
||||||
|
if (typeof $scope.sizeEqual != 'undefined') $scope.sizeEqual = false;
|
||||||
|
|
||||||
var decimalPlaces = {
|
var decimalPlaces = {
|
||||||
'0': ['BIF', 'CLP', 'DJF', 'GNF', 'ILS', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'],
|
'0': ['BIF', 'CLP', 'DJF', 'GNF', 'ILS', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'],
|
||||||
'3': ['BHD', 'IQD', 'JOD', 'KWD', 'OMR', 'TND'],
|
'3': ['BHD', 'IQD', 'JOD', 'KWD', 'OMR', 'TND'],
|
||||||
|
|
|
||||||
|
|
@ -30,5 +30,6 @@
|
||||||
.currency {
|
.currency {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15083,9 +15083,14 @@ log-options #check-bar .checkbox-icon {
|
||||||
font-size: 0.7857em;
|
font-size: 0.7857em;
|
||||||
margin-left: 5px; }
|
margin-left: 5px; }
|
||||||
|
|
||||||
|
.amount.size-equal .middle,
|
||||||
|
.amount.size-equal .end {
|
||||||
|
font-size: 1em; }
|
||||||
|
|
||||||
.amount .currency {
|
.amount .currency {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
margin-left: 5px; }
|
margin-left: 5px;
|
||||||
|
text-transform: uppercase; }
|
||||||
|
|
||||||
/* This is for rules that don't yet have a home.
|
/* This is for rules that don't yet have a home.
|
||||||
* Our goal is to delete this file. Search the regex: /class=".*CLASS.*?"/
|
* Our goal is to delete this file. Search the regex: /class=".*CLASS.*?"/
|
||||||
|
|
|
||||||
4
www/views/includes/amount.html
Normal file
4
www/views/includes/amount.html
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<div class="amount"
|
||||||
|
ng-class="{ 'size-equal': sizeEqual }">
|
||||||
|
<span ng-if="start.length > 0" class="start">{{start}}</span><span ng-if="middle.length > 0" class="middle">{{middle}}</span><span ng-if="end.length > 0" class="end">{{end}}</span><span ng-if="currency.length > 0" class="currency">{{currency}}</span>
|
||||||
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue