From 959e5fb79d0a5b3cf0cd77a97bb59f1798ada46d Mon Sep 17 00:00:00 2001 From: javiexin Date: Sat, 10 Dec 2016 00:51:41 +0100 Subject: [PATCH 1/3] [ticket/14855] Update notification and PM alert bubbles Alternative implementation without removing notification from the DOM, but changing the class. So that style designers might have more options (show/not show). PHPBB3-14855 --- phpBB/styles/prosilver/template/ajax.js | 5 +++-- phpBB/styles/prosilver/template/navbar_header.html | 4 ++-- phpBB/styles/prosilver/theme/common.css | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 311da92a95..ec9b53328f 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -132,9 +132,10 @@ phpbb.markNotifications = function($popup, unreadCount) { // Update the unread count. $('strong', '#notification_list_button').html(unreadCount); - // Remove the Mark all read link & notification count if there are no unread notifications. + // Remove the Mark all read link and hide notification count if there are no unread notifications. if (!unreadCount) { - $('#mark_all_notifications, #notification_list_button > strong').remove(); + $('#mark_all_notifications').remove(); + $('#notification_list_button > strong').addClass('hidden'); } // Update page title diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html index e5f354a943..bdfb5fb87d 100644 --- a/phpBB/styles/prosilver/template/navbar_header.html +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -72,12 +72,12 @@
  • - {L_PRIVATE_MESSAGES} {PRIVATE_MESSAGE_COUNT} + {L_PRIVATE_MESSAGES} {PRIVATE_MESSAGE_COUNT}
  • diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index cf6d14e6ab..0ac7a45a23 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -1269,6 +1269,10 @@ ul.linklist:after, padding: 4px 6px; } +.badge.hidden { + display: none; +} + /* Navbar specific list items ----------------------------------------*/ From 41b3450f2f93158e6a8135657b21030eb5d6b3c9 Mon Sep 17 00:00:00 2001 From: javiexin Date: Sat, 10 Dec 2016 11:41:11 +0100 Subject: [PATCH 2/3] [ticket/14855] Update notification and PM alert bubbles Alternative implementation without removing notification from the DOM, but changing the class. So that style designers might have more options (show/not show). Fix tests. PHPBB3-14855 --- tests/functional/notification_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php index d4c61cc062..da36387aa1 100644 --- a/tests/functional/notification_test.php +++ b/tests/functional/notification_test.php @@ -82,6 +82,6 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case // Get form token $link = $crawler->selectLink($this->lang('NOTIFICATIONS_MARK_ALL_READ'))->link()->getUri(); $crawler = self::request('GET', substr($link, strpos($link, 'ucp.'))); - $this->assertCount(0, $crawler->filter('#notification_list_button strong')); + $this->assertEquals(0, $crawler->filter('#notification_list_button strong.badge.hidden')->text()); } } From daae2147c867335f8af0c64b78b4c9f674eb0d27 Mon Sep 17 00:00:00 2001 From: javiexin Date: Sat, 10 Dec 2016 18:09:31 +0100 Subject: [PATCH 3/3] [ticket/14855] Update notification and PM alert bubbles Alternative implementation without removing notification from the DOM, but changing the class. So that style designers might have more options (show/not show). Fix tests better. PHPBB3-14855 --- tests/functional/notification_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php index da36387aa1..f21d73817a 100644 --- a/tests/functional/notification_test.php +++ b/tests/functional/notification_test.php @@ -82,6 +82,7 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case // Get form token $link = $crawler->selectLink($this->lang('NOTIFICATIONS_MARK_ALL_READ'))->link()->getUri(); $crawler = self::request('GET', substr($link, strpos($link, 'ucp.'))); - $this->assertEquals(0, $crawler->filter('#notification_list_button strong.badge.hidden')->text()); + $this->assertCount(1, $crawler->filter('#notification_list_button strong.badge.hidden')); + $this->assertEquals("0", $crawler->filter('#notification_list_button strong.badge.hidden')->text()); } }