Skip to content

Commit

Permalink
have the margin-right be align with the labelPadding and remove the a…
Browse files Browse the repository at this point in the history
…dded space in the icon NA label
  • Loading branch information
schloerke committed Mar 27, 2018
1 parent 5aa8ef6 commit a7272b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inst/htmlwidgets/leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ methods.addLegend = function (options) {
});

if (options.na_color && _jquery2.default.inArray(options.na_label, labels) < 0) {
(0, _jquery2.default)(div).append("<div><i style=\"background:" + options.na_color + ";opacity:" + options.opacity + ";\"></i> " + options.na_label + "</div>");
(0, _jquery2.default)(div).append("<div><i style=\"" + "background:" + options.na_color + ";opacity:" + options.opacity + ";margin-right:" + labelPadding + "px" + ";\"></i>" + options.na_label + "</div>");
}
})();
} else {
Expand Down
6 changes: 4 additions & 2 deletions javascript/src/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,11 @@ methods.addLegend = function(options) {
});

if (options.na_color && ($.inArray(options.na_label, labels)<0) ) {
$(div).append("<div><i style=\"background:" + options.na_color +
$(div).append("<div><i style=\"" +
"background:" + options.na_color +
";opacity:" + options.opacity +
";\"></i> " + options.na_label + "</div>");
";margin-right:" + labelPadding + "px" +
";\"></i>" + options.na_label + "</div>");
}
} else {
if (options.na_color && ($.inArray(options.na_label, labels)<0) ) {
Expand Down

0 comments on commit a7272b6

Please sign in to comment.