<commit_before>chorus.views.WorkfileShowSidebar = chorus.views.Sidebar.extend({
    className:"workfile_show_sidebar",
    useLoadingSection:true,

    events:{
        "click a.version_list":"displayVersionList"
    },
    subviews:{
        '.activity_list':'activityList',
        '.tab_control':'tabControl'
    },

    setup:function () {
        this.collection = this.model.activities();
        this.collection.fetch();
        this.collection.bind("changed", this.render, this);
        this.activityList = new chorus.views.ActivityList({
            collection:this.collection,
            headingText:t("workfile.content_details.activity"),
            additionalClass:"sidebar",
            displayStyle:['without_object', 'without_workspace']
        });

        this.allVersions = this.model.allVersions();
        this.versionList = new chorus.views.WorkfileVersionList({collection:this.allVersions});
        this.allVersions.fetch();
        this.model.bind("invalidated", this.allVersions.fetch, this.allVersions);
        this.allVersions.bind("changed", this.render, this);
        this.requiredResources.push(this.model);
        this.requiredResources.push(this.model.workspace());
    },

    resourcesLoaded:function () {
        var tabs = [
            {name:'activity_list'}
        ];

        if (this.model.isSql()) {
            tabs.push({name:'database_function_list'});
            tabs.push({name:"datasets_and_columns"});

            this.functionList = new chorus.views.DatabaseFunctionSidebarList({ sandbox:this.model.workspace().sandbox() });
            this.datasetList = new chorus.views.DatabaseDatasetSidebarList({ sandbox:this.model.workspace().sandbox() });
            this.columnList = new chorus.views.DatabaseColumnSidebarList({ sandbox:this.model.workspace().sandbox() });

            this.datasetList.bind("datasetSelected", function (tableOrView) {
                this.columnList.trigger("datasetSelected", tableOrView);
                this.$(".database_column_list").removeClass("hidden");
                this.$(".database_dataset_list").addClass("hidden");
            }, this);

            this.columnList.bind("back", function () {
                this.$("input.search").val("");
                this.$(".database_dataset_list").removeClass("hidden");
                this.$(".database_column_list").addClass("hidden");
            }, this);

            this.subviews[".tabbed_area .database_function_list"] = "functionList";
            this.subviews[".tabbed_area .database_dataset_list"] = "datasetList";
            this.subviews[".tabbed_area .database_column_list"] = "columnList";
        }
        this.tabControl = new chorus.views.TabControl(tabs);
        this.tabControl.bind("selected", _.bind(this.recalculateScrolling, this))
    },

    postRender:function () {
        var versionList = this.versionList;
        this.$("a.version_list").qtip({
            content:{
                text:function () {
                    return $(versionList.render().el);
                }
            },
            show:'click',
            hide:'unfocus',
            position:{
                my:"top center",
                at:"bottom center"
            },
            style:{
                classes:"tooltip-white",
                tip:{
                    width:20,
                    height:15
                }
            }
        });
        this._super('postRender');
    },

    displayVersionList:function (e) {
        e.preventDefault();
    },

    additionalContext:function (ctx) {
        return {
            updatedBy:[this.model.get("modifiedByFirstName"), this.model.get("modifiedByLastName")].join(' '),
            modifierUrl:this.model.modifier().showUrl(),
            downloadUrl:this.model.downloadUrl()
        }
    }
});<commit_msg>fix qtip position for workfile sidebar version menu on ie9<commit_after>chorus.views.WorkfileShowSidebar = chorus.views.Sidebar.extend({
    className:"workfile_show_sidebar",
    useLoadingSection:true,

    events:{
        "click a.version_list":"displayVersionList"
    },
    subviews:{
        '.activity_list':'activityList',
        '.tab_control':'tabControl'
    },

    setup:function () {
        this.collection = this.model.activities();
        this.collection.fetch();
        this.collection.bind("changed", this.render, this);
        this.activityList = new chorus.views.ActivityList({
            collection:this.collection,
            headingText:t("workfile.content_details.activity"),
            additionalClass:"sidebar",
            displayStyle:['without_object', 'without_workspace']
        });

        this.allVersions = this.model.allVersions();
        this.versionList = new chorus.views.WorkfileVersionList({collection:this.allVersions});
        this.allVersions.fetch();
        this.model.bind("invalidated", this.allVersions.fetch, this.allVersions);
        this.allVersions.bind("changed", this.render, this);
        this.requiredResources.push(this.model);
        this.requiredResources.push(this.model.workspace());
    },

    resourcesLoaded:function () {
        var tabs = [
            {name:'activity_list'}
        ];

        if (this.model.isSql()) {
            tabs.push({name:'database_function_list'});
            tabs.push({name:"datasets_and_columns"});

            this.functionList = new chorus.views.DatabaseFunctionSidebarList({ sandbox:this.model.workspace().sandbox() });
            this.datasetList = new chorus.views.DatabaseDatasetSidebarList({ sandbox:this.model.workspace().sandbox() });
            this.columnList = new chorus.views.DatabaseColumnSidebarList({ sandbox:this.model.workspace().sandbox() });

            this.datasetList.bind("datasetSelected", function (tableOrView) {
                this.columnList.trigger("datasetSelected", tableOrView);
                this.$(".database_column_list").removeClass("hidden");
                this.$(".database_dataset_list").addClass("hidden");
            }, this);

            this.columnList.bind("back", function () {
                this.$("input.search").val("");
                this.$(".database_dataset_list").removeClass("hidden");
                this.$(".database_column_list").addClass("hidden");
            }, this);

            this.subviews[".tabbed_area .database_function_list"] = "functionList";
            this.subviews[".tabbed_area .database_dataset_list"] = "datasetList";
            this.subviews[".tabbed_area .database_column_list"] = "columnList";
        }
        this.tabControl = new chorus.views.TabControl(tabs);
        this.tabControl.bind("selected", _.bind(this.recalculateScrolling, this))
    },

    postRender:function () {
        this._super('postRender');
        var versionList = this.versionList.render();
        chorus.menu(this.$('a.version_list'), {
            content:$(versionList.el)
        });

    },

    displayVersionList:function (e) {
        e.preventDefault();
    },

    additionalContext:function (ctx) {
        return {
            updatedBy:[this.model.get("modifiedByFirstName"), this.model.get("modifiedByLastName")].join(' '),
            modifierUrl:this.model.modifier().showUrl(),
            downloadUrl:this.model.downloadUrl()
        }
    }
});
{'fraction_non_alphanumeric': 0.1425832077797562, 'fraction_numerical': 0.0006848376934666484, 'mean_word_length': 2.4201405152224824, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5904371', 'n_tokens_mistral': 1995, 'n_tokens_neox': 1920, 'n_words': 234}