Browse Source

Rename file, change border color if applies too.

pull/40/head
Jairo Llopis 9 years ago
parent
commit
26ce915dd4
  1. 10
      website_mail_snippet_bg_color/static/src/js/bg_color_picker.js

10
website_mail_snippet_bg_color/static/src/js/bg_color_chooser.js → website_mail_snippet_bg_color/static/src/js/bg_color_picker.js

@ -24,12 +24,22 @@
}, },
change: function(color) { change: function(color) {
var oldcolor = this.$target.css("background-color"),
sides = ["top", "bottom", "left", "right"];
this.$target.css("background-color", color); this.$target.css("background-color", color);
// Old-school bgcolor attribute if the element already had one // Old-school bgcolor attribute if the element already had one
if (this.$target.attr("bgcolor")) { if (this.$target.attr("bgcolor")) {
this.$target.attr("bgcolor", color); this.$target.attr("bgcolor", color);
} }
// Match border colors if it was the same
for (var n in sides) {
var property = "border-" + sides[n] + "-color";
if (this.$target.css(property) == oldcolor) {
this.$target.css(property, color);
}
}
}, },
}); });
})(jQuery); })(jQuery);
Loading…
Cancel
Save