From 4d80c837428cc3e4ec3522d9d81536fecdcb5d38 Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Thu, 4 Nov 2021 22:58:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Cleaning=20and=20improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjetProgWeb/app.js | 2 +- ProjetProgWeb/class/dump.php | 7 +------ ProjetProgWeb/stylesheet.css | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ProjetProgWeb/app.js b/ProjetProgWeb/app.js index d7bde81..3556b44 100644 --- a/ProjetProgWeb/app.js +++ b/ProjetProgWeb/app.js @@ -115,7 +115,7 @@ function realTimeDisplay() { suggestions.innerHTML = "" if (!results.data.length) { hideSuggestions() - } else { + } else if (document.activeElement === searchBar) { showSuggestions() } results.data.forEach(elem => { diff --git a/ProjetProgWeb/class/dump.php b/ProjetProgWeb/class/dump.php index aa12af4..f7d791b 100644 --- a/ProjetProgWeb/class/dump.php +++ b/ProjetProgWeb/class/dump.php @@ -8,9 +8,6 @@ require_once("conf.php"); class dump { private these $these; - /** - * @param these $these - */ public function __construct(these $these) { $this->these = $these; } @@ -51,16 +48,14 @@ class dump { $pdo_obj = new conf(); $pdo = $pdo_obj->getPDO(); - $stmt = $pdo->prepare("SELECT author FROM theses WHERE author LIKE :author_name LIMIT 10;"); + $stmt = $pdo->prepare("SELECT DISTINCT author FROM theses WHERE author LIKE :author_name LIMIT 10;"); $stmt->bindParam(':author_name', $author_name, PDO::PARAM_STR, 100); $stmt->execute(); - $i = 0; while ($obj = $stmt->fetchObject()) { foreach ($obj as $elem) { array_push($array, $elem); } - $i++; } return $array; diff --git a/ProjetProgWeb/stylesheet.css b/ProjetProgWeb/stylesheet.css index 97c356a..e18a0f4 100644 --- a/ProjetProgWeb/stylesheet.css +++ b/ProjetProgWeb/stylesheet.css @@ -143,6 +143,7 @@ header { } #hamburger { + user-select: none; fill: white; min-width: 30px; min-height: 30px;