diff --git a/app/views/admin/communication/unsplash/_selector.html.erb b/app/views/admin/communication/unsplash/_selector.html.erb index 5253fbfe8b6ea9674d85873deaf3924bb9c3ce46..6d8d106d4203183c890c64be88bca818713c60f0 100644 --- a/app/views/admin/communication/unsplash/_selector.html.erb +++ b/app/views/admin/communication/unsplash/_selector.html.erb @@ -117,7 +117,7 @@ path = admin_communication_unsplash_path(website_id: nil, format: :json) modalElement.addEventListener('show.bs.modal', function (){ this.isOpened = true; - this.search.bind(this) + this.search() }.bind(this)); modalElement.addEventListener('hide.bs.modal', function() { @@ -128,6 +128,7 @@ path = admin_communication_unsplash_path(website_id: nil, format: :json) if (event.key === "Enter" && this.isOpened) { event.preventDefault(); event.stopImmediatePropagation(); + this.search(); } }.bind(this)); },