diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index ba847589..dc6cd995 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -448,10 +448,19 @@ class calendar extends rcube_plugin var color = $("").attr("type", "text").attr("name", "_colors[]").attr("size", 6).addClass("colors").val("000000"); var button = $("").attr("type", "button").attr("value", "X").addClass("button").click(function(){ $(this).parent().remove() }); $("
").append(input).append(" ").append(color).append(" ").append(button).appendTo("#calendarcategories"); - color.miniColors({ colorValues:mscolors }); + color.miniColors({ colorValues:(rcmail.env.mscolors || []) }); + $("#rcmfd_new_category").val(""); } }'); + $this->rc->output->add_script('$("#rcmfd_new_category").keypress(function(event){ + if (event.which == 13) { + rcube_calendar_add_category(); + event.preventDefault(); + } + }); + ', 'docready'); + // include color picker $this->include_script('lib/js/jquery.miniColors.min.js'); $this->include_stylesheet($this->local_skin_path() . '/jquery.miniColors.css');