Skip to content

Commit a7272b6

Browse files
committed
have the margin-right be align with the labelPadding and remove the added space in the icon NA label
1 parent 5aa8ef6 commit a7272b6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

inst/htmlwidgets/leaflet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ methods.addLegend = function (options) {
18831883
});
18841884

18851885
if (options.na_color && _jquery2.default.inArray(options.na_label, labels) < 0) {
1886-
(0, _jquery2.default)(div).append("<div><i style=\"background:" + options.na_color + ";opacity:" + options.opacity + ";\"></i> " + options.na_label + "</div>");
1886+
(0, _jquery2.default)(div).append("<div><i style=\"" + "background:" + options.na_color + ";opacity:" + options.opacity + ";margin-right:" + labelPadding + "px" + ";\"></i>" + options.na_label + "</div>");
18871887
}
18881888
})();
18891889
} else {

javascript/src/methods.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,11 @@ methods.addLegend = function(options) {
789789
});
790790

791791
if (options.na_color && ($.inArray(options.na_label, labels)<0) ) {
792-
$(div).append("<div><i style=\"background:" + options.na_color +
792+
$(div).append("<div><i style=\"" +
793+
"background:" + options.na_color +
793794
";opacity:" + options.opacity +
794-
";\"></i> " + options.na_label + "</div>");
795+
";margin-right:" + labelPadding + "px" +
796+
";\"></i>" + options.na_label + "</div>");
795797
}
796798
} else {
797799
if (options.na_color && ($.inArray(options.na_label, labels)<0) ) {

0 commit comments

Comments
 (0)