diff --git a/module/VuFind/src/VuFind/Cover/Generator.php b/module/VuFind/src/VuFind/Cover/Generator.php index 474d79255b9f2cb9d6130521ed7ceb2e3d795931..3ee6f9a1167995b7e2d7dd3d4ab7ba46dd62eb51 100644 --- a/module/VuFind/src/VuFind/Cover/Generator.php +++ b/module/VuFind/src/VuFind/Cover/Generator.php @@ -442,12 +442,18 @@ class Generator $q = (integer)($v * (1.0 - $s * $f)); $t = (integer)($v * (1.0 - $s * (1.0 - $f))); switch($i) { - case 0: return imagecolorallocate($im, $v, $t, $p); - case 1: return imagecolorallocate($im, $q, $v, $p); - case 2: return imagecolorallocate($im, $p, $v, $t); - case 3: return imagecolorallocate($im, $p, $q, $v); - case 4: return imagecolorallocate($im, $t, $p, $v); - default: return imagecolorallocate($im, $v, $p, $q); + case 0: + return imagecolorallocate($im, $v, $t, $p); + case 1: + return imagecolorallocate($im, $q, $v, $p); + case 2: + return imagecolorallocate($im, $p, $v, $t); + case 3: + return imagecolorallocate($im, $p, $q, $v); + case 4: + return imagecolorallocate($im, $t, $p, $v); + default: + return imagecolorallocate($im, $v, $p, $q); } return imagecolorallocate($im, $R, $G, $B); } diff --git a/themes/bootstrap/js/common.js b/themes/bootstrap/js/common.js index 6a5e42e394cacef5e1337d85e0795f67d1723980..3d209115b3e0e160861b826417bffa93a0fd8758 100644 --- a/themes/bootstrap/js/common.js +++ b/themes/bootstrap/js/common.js @@ -254,7 +254,7 @@ $.fn.typeahead.Constructor.prototype.render = function(items) { i = $(that.options.item).attr('data-value', item); i.find('a').html(that.highlighter(item)); return i[0]; - }) + }); this.$menu.html(items); return this; @@ -264,11 +264,10 @@ $.fn.typeahead.Constructor.prototype.select = function () { var val = this.$menu.find('.active'); if (val.length > 0) { val = val.attr('data-value'); + } else { + val = this.$element.val(); } - else val = this.$element.val(); - this.$element - .val(this.updater(val)) - .change(); + this.$element.val(this.updater(val)).change(); return this.hide(); }