From 9d969cf1c5234268f611c0c8e1f2f7f390a5ed52 Mon Sep 17 00:00:00 2001 From: Piotr Jasiun Date: Mon, 9 Feb 2015 16:22:48 +0100 Subject: [PATCH 1/3] Focus editor after hide. --- plugins/notification/plugin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/notification/plugin.js b/plugins/notification/plugin.js index 7a793ae26ab..ac6ceff07d9 100644 --- a/plugins/notification/plugin.js +++ b/plugins/notification/plugin.js @@ -298,6 +298,9 @@ Notification.prototype = { } this.area.remove( this ); + + // Focus editor on close (#12865) + this.editor.focus(); }, /** From 26e3f0c5c87386f87ec99512f0e9952bd756b0d6 Mon Sep 17 00:00:00 2001 From: Piotr Jasiun Date: Mon, 16 Feb 2015 14:40:33 +0100 Subject: [PATCH 2/3] Tests: added manual test. --- tests/plugins/notification/manual/focus.html | 33 ++++++++++++++++++++ tests/plugins/notification/manual/focus.md | 9 ++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/plugins/notification/manual/focus.html create mode 100644 tests/plugins/notification/manual/focus.md diff --git a/tests/plugins/notification/manual/focus.html b/tests/plugins/notification/manual/focus.html new file mode 100644 index 00000000000..34f95d73b3e --- /dev/null +++ b/tests/plugins/notification/manual/focus.html @@ -0,0 +1,33 @@ +
+

Apollo 11 was the spaceflight that landed the first humans, Americans Neil Armstrong and Buzz Aldrin, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.

+

Armstrong spent about three and a half two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.

+

Broadcasting and quotes

+

Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:

+

One small step for [a] man, one giant leap for mankind.

+

Apollo 11 effectively ended the Space Race and fulfilled a national goal proposed in 1961 by the late U.S. President John F. Kennedy in a speech before the United States Congress:

+

[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.

+

Technical details

+

Mission crew

+

PositionAstronaut

+

CommanderNeil A. Armstrong

+

Command Module PilotMichael Collins

+

Lunar Module PilotEdwin "Buzz" E. Aldrin, Jr.

+

Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of NASA's Apollo program. The Apollo spacecraft had three parts:

+

Command Module with a cabin for the three astronauts which was the only part which landed back on Earth

+

Service Module which supported the Command Module with propulsion, electrical power, oxygen and water

+

Lunar Module for landing on the Moon.

+

After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean on July 24.

+

Source: Wikipedia.org

+
+ \ No newline at end of file diff --git a/tests/plugins/notification/manual/focus.md b/tests/plugins/notification/manual/focus.md new file mode 100644 index 00000000000..5142c34ca7e --- /dev/null +++ b/tests/plugins/notification/manual/focus.md @@ -0,0 +1,9 @@ +@bender-tags: 4.5.0 +@bender-ui: collapsed +@bender-ckeditor-plugins: wysiwygarea, toolbar, undo, basicstyles, notification, floatingspace +@bender-include: _helpers/manualplayground.js + +1. Focus editor. +2. Close notification using "x" button. + +Expected result: editor should be focused. \ No newline at end of file From 53106ca106b6d82341213350ab150cc4b535e756 Mon Sep 17 00:00:00 2001 From: Piotr Jasiun Date: Wed, 11 Mar 2015 17:44:12 +0100 Subject: [PATCH 3/3] Focus on click instead of hide. --- plugins/notification/plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/notification/plugin.js b/plugins/notification/plugin.js index ac6ceff07d9..0ae40ed8755 100644 --- a/plugins/notification/plugin.js +++ b/plugins/notification/plugin.js @@ -298,9 +298,6 @@ Notification.prototype = { } this.area.remove( this ); - - // Focus editor on close (#12865) - this.editor.focus(); }, /** @@ -347,6 +344,9 @@ Notification.prototype = { notificationElement.append( notificationCloseElement ); notificationCloseElement.on( 'click', function() { + // Focus editor on close (#12865) + notification.editor.focus(); + notification.hide(); } );