Sha256: 6beba282cb3f31588cbd8c4bf689aa5e08811b2cf5232f1fb15f5c197ec6afe1

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

$(document).ready(function(){

    if(!PivotalReporter::Engine.config.enabled) return;

    ar slide_action    = -1;
    var container_width = -1;

    $pr_toggle = $('<a href="#" id="pr_report_button" title="Report Bug or Request Feature">!</a>');
    $pr_container = $('<div id="pivotal_reporter">');
    $pr_frame = $('<iframe id="pivotal_reporter_window" border="0" >').attr('src', '<%= PivotalReporter::Engine.config.mount_point %>');
    $pr_container.append($pr_frame).hide();

    $pr_toggle.click(function(e){
        h_slide_toggle($pr_container)
    });

    $pr_container
        .mouseover(function(e) {
            clearTimeout(slide_action);
        })
        .mouseout(function(e) {
            slide_action = setTimeout(toggle_report_window, 500);
        });

    $('body').prepend($pr_container).prepend($pr_toggle);

    var container_width = $pr_container.width();

    $pr_container.css('width', 0).css('top', $pr_toggle.css('top')).show();

    function toggle_report_window()
    {
        h_slide_toggle($pr_container);
    }
    function h_slide_toggle($obj)
    {
        var new_w = $obj.css('width') == '0px' ? container_width : 0;

        $obj.animate(
            {
                width: new_w
            },
            250,
            'swing');
    }

});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pivotal_reporter-0.7.0 app/assets/javascripts/pivotal_reporter/report_button.js.erb