From a1538e12e81126e8f9d29cf631a15ea1c069aedc Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Mon, 14 Aug 2017 20:30:23 +0200 Subject: [PATCH] Bugfix typeahead on advanced serach page --- cps/static/js/edit_books.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cps/static/js/edit_books.js b/cps/static/js/edit_books.js index bb9e1040..18acccc1 100644 --- a/cps/static/js/edit_books.js +++ b/cps/static/js/edit_books.js @@ -3,6 +3,7 @@ */ /* global Bloodhound, language, Modernizr, tinymce */ +if ($("#description").length) { tinymce.init({ selector: "#description", branding: false, @@ -10,6 +11,7 @@ tinymce.init({ language }); + if (!Modernizr.inputtypes.date) { $("#pubdate").datepicker({ format: "yyyy-mm-dd", @@ -26,7 +28,7 @@ if (!Modernizr.inputtypes.date) { .removeClass("hidden"); }).trigger("change"); } - +} /* Takes a prefix, query typeahead callback, Bloodhound typeahead adapter and returns the completions it gets from the bloodhound engine prefixed.