mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-28 01:50:09 +00:00
Remove fire_event("onfocus") from next/previous/exit actions, not needed
As suggested by Chrismcmahon, I confirmed that there is no need to fire the onfocus event. We also remove the convenient functions around this logic. Change-Id: I00ce04c758e496f76bd5c2a43ad933c952acc5fb
This commit is contained in:
parent
c66b57d701
commit
8a1bf00ef0
|
@ -11,19 +11,19 @@ end
|
||||||
|
|
||||||
When(/^I click the next arrow$/) do
|
When(/^I click the next arrow$/) do
|
||||||
on(LightboxDemoPage) do |page|
|
on(LightboxDemoPage) do |page|
|
||||||
page.next_image()
|
page.mmv_next_button_element.when_present.click
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
When(/^I click the previous arrow$/) do
|
When(/^I click the previous arrow$/) do
|
||||||
on(LightboxDemoPage) do |page|
|
on(LightboxDemoPage) do |page|
|
||||||
page.previous_image()
|
page.mmv_previous_button_element.when_present.click
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
When(/^I close MMV$/) do
|
When(/^I close MMV$/) do
|
||||||
on(LightboxDemoPage) do |page|
|
on(LightboxDemoPage) do |page|
|
||||||
page.exit_mmv()
|
page.mmv_close_button_element.when_present.click
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -37,21 +37,4 @@ class LightboxDemoPage
|
||||||
div(:mmv_next_button, class: "mw-mlb-next-image")
|
div(:mmv_next_button, class: "mw-mlb-next-image")
|
||||||
div(:mmv_previous_button, class: "mw-mlb-prev-image")
|
div(:mmv_previous_button, class: "mw-mlb-prev-image")
|
||||||
div(:mmv_close_button, class: "mlb-close")
|
div(:mmv_close_button, class: "mlb-close")
|
||||||
|
|
||||||
# Convenient functions on some of these elements
|
|
||||||
def next_image()
|
|
||||||
mmv_next_button_element.fire_event("onfocus")
|
|
||||||
mmv_next_button_element.when_present.click
|
|
||||||
end
|
|
||||||
|
|
||||||
def previous_image()
|
|
||||||
mmv_previous_button_element.fire_event("onfocus")
|
|
||||||
mmv_previous_button_element.when_present.click
|
|
||||||
end
|
|
||||||
|
|
||||||
def exit_mmv()
|
|
||||||
mmv_close_button_element.fire_event("onfocus")
|
|
||||||
mmv_close_button_element.when_present.click
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue