Sha256: fe6450b1d9b079c1477c4fe64013aa4f633329797655b9baf3425fbcb91ea0fc

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 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.2 app/assets/javascripts/pivotal_reporter/report_button.js.erb