Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2428 from darkdarkdragon/develop-RT-3357
Browse files Browse the repository at this point in the history
[FIX] addressPopover: use $templateRequest (RT-3357)
  • Loading branch information
mrajvanshy committed Apr 29, 2015
2 parents 473f1af + 43eddc1 commit 6d0d549
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/js/directives/addressPopover.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,8 @@
}
}

var myTemplate = require('../../templates/directives/addresspopover.jade')();
var texts = myTemplate.split('<br/>');

AddressPopover.textRippleAddress = texts[0];
AddressPopover.textShowInGraph = texts.length > 1 ? texts[1] : 'Show in graph';
AddressPopover.textRippleAddress = 'span(l10n) Ripple address';
AddressPopover.textShowInGraph = 'span(l10n) Show in graph';

/**
* Special popover to show ripple address with ability to double click on address to select.
Expand All @@ -212,9 +209,15 @@
*/
angular.module('directives').directive('rpAddressPopover', rpAddressPopover);

rpAddressPopover.$inject = ['$timeout', 'rpId', '$filter', '$parse'];
rpAddressPopover.$inject = ['$timeout', 'rpId', '$filter', '$parse', '$templateRequest'];

function rpAddressPopover($timeout, id, $filter, $parse, $templateRequest) {
$templateRequest('templates/' + window.lang + '/directives/addresspopover.html', false).then(function(template) {
var texts = template.split('<br/>');
AddressPopover.textRippleAddress = texts[0];
AddressPopover.textShowInGraph = texts.length > 1 ? texts[1] : AddressPopover.textShowInGraph;
});

function rpAddressPopover($timeout, id, $filter, $parse) {
return {
restrict: 'A',
replace: false,
Expand Down

0 comments on commit 6d0d549

Please sign in to comment.