<commit_before>/**
 * Datagrid pagination with input field
 *
 * @class   OroApp.DatagridPaginationInput
 * @extends OroApp.DatagridPagination
 */
OroApp.DatagridPaginationInput = OroApp.DatagridPagination.extend({
    /** @property */
    template: _.template(
        '<label class="dib">Page:</label>' +
        '<ul class="icons-holder">' +
            '<% _.each(handles, function (handle) { %>' +
                '<li <% if (handle.className || disabled) { %>class="<%= handle.className %> <% if (disabled) { %>disabled<% } %>"<% } %>>' +
                    '<% if (handle.type == "input") { %>' +
                        '<input type="text" value="<%= state.firstPage == 0 ? state.currentPage + 1 : state.currentPage  %>"' +
                            ' <% if (disabled) { %>disabled="disabled"<% } %>' +
                        '/>' +
                    '<% } else { %>' +
                        '<a href="#" <% if (handle.title) {%> title="<%= handle.title %>"<% } %>>' +
                            '<% if (handle.wrapClass) {%>' +
                                '<i <% if (handle.wrapClass) { %>class="<%= handle.wrapClass %>"<% } %>>' +
                                    '<%= handle.label %>' +
                                '</i>' +
                            '<% } else { %>' +
                                '<%= handle.label %>' +
                            '<% } %>' +
                        '</a>' +
                    '<% } %>' +
                '</li>' +
            '<% }); %>' +
        '</ul>' +
        '<label class="dib">of <%= state.totalPages ? state.totalPages : 1 %> | <%= state.totalRecords %> records</label>'
    ),

    /** @property */
    events: {
        "click a": "onChangePage",
        "change input": "onChangePageByInput",
        "blur input": "onChangePageByInput"
    },

    /** @property */
    windowSize: 0,

    /**
     * @inheritDoc
     */
    initialize: function (options) {
        OroApp.DatagridPagination.prototype.initialize.call(this, options);
    },

    /**
     * Apply change of pagination page input<commit_msg>BAP-438: Enter key is not working in pagination of grid in IE8 - fix bug<commit_after>/**
 * Datagrid pagination with input field
 *
 * @class   OroApp.DatagridPaginationInput
 * @extends OroApp.DatagridPagination
 */
OroApp.DatagridPaginationInput = OroApp.DatagridPagination.extend({
    /** @property */
    template: _.template(
        '<label class="dib">Page:</label>' +
        '<ul class="icons-holder">' +
            '<% _.each(handles, function (handle) { %>' +
                '<li <% if (handle.className || disabled) { %>class="<%= handle.className %> <% if (disabled) { %>disabled<% } %>"<% } %>>' +
                    '<% if (handle.type == "input") { %>' +
                        '<input type="text" value="<%= state.firstPage == 0 ? state.currentPage + 1 : state.currentPage  %>"' +
                            ' <% if (disabled) { %>disabled="disabled"<% } %>' +
                        '/>' +
                    '<% } else { %>' +
                        '<a href="#" <% if (handle.title) {%> title="<%= handle.title %>"<% } %>>' +
                            '<% if (handle.wrapClass) {%>' +
                                '<i <% if (handle.wrapClass) { %>class="<%= handle.wrapClass %>"<% } %>>' +
                                    '<%= handle.label %>' +
                                '</i>' +
                            '<% } else { %>' +
                                '<%= handle.label %>' +
                            '<% } %>' +
                        '</a>' +
                    '<% } %>' +
                '</li>' +
            '<% }); %>' +
        '</ul>' +
        '<label class="dib">of <%= state.totalPages ? state.totalPages : 1 %> | <%= state.totalRecords %> records</label>'
    ),

    /** @property */
    events: {
        "click a": "onChangePage",
        "blur input": "onChangePageByInput",
        "change input": "onChangePageByInput",
        'keyup input': function(e) {
            if (e.which == 13) {
                // fix for IE 8, bacause change event is not fired when enter is pressed
                this.onChangePageByInput(e);
            }
        }
    },

    /** @property */
    windowSize: 0,

    /**
     * @inheritDoc
     */
    initialize: function (options) {
        OroApp.DatagridPagination.prototype.initialize.call(this, options);
    },

    /**
     * Apply change of pagination page input
{'fraction_non_alphanumeric': 0.1887846291331546, 'fraction_numerical': 0.003351206434316354, 'mean_word_length': 1.4571899012074643, 'pattern_counts': {'":': 6, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2016863', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1290, 'n_words': 231}