Skip to content
Snippets Groups Projects
Commit 7260a963 authored by Jared Hancock's avatar Jared Hancock
Browse files

Hide signature box when empty

Also, default size should not decrease if different signatures are selected
parent 70fbd04f
No related branches found
No related tags found
No related merge requests found
......@@ -121,13 +121,16 @@ RedactorPlugins.draft = {
RedactorPlugins.signature = {
init: function() {
var $el = $(this.$element.get(0));
var $el = $(this.$element.get(0)),
inner = $('<div class="inner"></div>');
if ($el.data('signatureField')) {
this.$signatureBox = $('<div class="selected-signature"></div>')
.append($('<div class="inner"></div>')
.html($el.data('signature'))
)
.append(inner)
.appendTo(this.$box);
if ($el.data('signature'))
inner.html($el.data('signature'));
else
this.$signatureBox.hide();
$('input[name='+$el.data('signatureField')+']', $el.closest('form'))
.on('change', false, false, $.proxy(this.updateSignature, this))
if ($el.data('deptField'))
......@@ -141,7 +144,7 @@ RedactorPlugins.signature = {
originalShadow = this.$signatureBox.css('box-shadow');
this.$signatureBox.hover(function() {
hoverTimeout = setTimeout($.proxy(function() {
originalHeight = outer.height()
originalHeight = Math.max(originalHeight, outer.height());
$(this).animate({
'height': inner.offsetHeight
}, 'fast');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment