Module: OpsManagerUiDrivers::AnimationHelper

Instance Method Summary collapse

Instance Method Details

#disable_css_transitions!(page_context = browser) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ops_manager_ui_drivers/animation_helper.rb', line 3

def disable_css_transitions!(page_context = browser)
  page_context.execute_script <<-JS
    // Turn off jQuery animations.
    jQuery.fx.off = true;

    // Turn off CSS transitions.
    var animationStyles = document.createElement('style');
    animationStyles.type = 'text/css';
    animationStyles.innerHTML = '* {' +
                                '  -webkit-transition: none !important;' +
                                '  -moz-transition: none !important;' +
                                '  -ms-transition: none !important;' +
                                '  -o-transition: none !important;' +
                                '  transition: none !important;' +
                                '  -webkit-animation: none !important;' +
                                '  -moz-animation: none !important;' +
                                '  -o-animation: none !important;' +
                                '  -ms-animation: none !important;' +
                                '  animation: none !important;' +
                                '}'
    document.head.appendChild(animationStyles);
  JS
end