View | Details | Raw Unified | Return to bug 26553
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js (-35 / +28 lines)
Lines 40-62 var dataTablesDefaults = { Link Here
40
        'clearFilter', 'copy', 'csv', 'print'
40
        'clearFilter', 'copy', 'csv', 'print'
41
    ],
41
    ],
42
    "paging": false,
42
    "paging": false,
43
    "buttons": [{
44
        fade: 100,
45
        className: "dt_button_clear_filter",
46
        titleAttr: __('Clear filter'),
47
        enabled: false,
48
        text: '<i class="fa fa-lg fa-times"></i> <span class="dt-button-text">' + __('Clear filter') + '</span>',
49
        available: function ( dt ) {
50
            // The "clear filter" button is made available if this test returns true
51
            if( dt.settings()[0].aanFeatures.f ){ // aanFeatures.f is null if there is no search form
52
                return true;
53
            }
54
        },
55
        action: function ( e, dt, node ) {
56
            dt.search( "" ).draw("page");
57
            node.addClass("disabled");
58
        }
59
    }],
60
    initComplete: function( settings) {
43
    initComplete: function( settings) {
61
        var tableId = settings.nTable.id;
44
        var tableId = settings.nTable.id;
62
        state =  settings.oLoadedState;
45
        state =  settings.oLoadedState;
Lines 173-192 function _dt_buttons(params){ Link Here
173
        }
156
        }
174
    ];
157
    ];
175
158
176
    let buttons = [];
159
    let buttons = [
177
    buttons.push(
178
        {
160
        {
179
            fade: 100,
161
            fade: 100,
180
            className: "dt_button_clear_filter",
162
            className: "dt_button_clear_filter",
181
            titleAttr: __("Clear filter"),
163
            titleAttr: _("Clear filter"),
182
            enabled: false,
164
            enabled: false,
183
            text: '<i class="fa fa-lg fa-remove"></i> <span class="dt-button-text">' + __("Clear filter") + '</span>',
165
            text: '<i class="fa fa-lg fa-times" aria-hidden="true"></i> <span class="dt-button-text">' + _("Clear filter") + '</span>',
184
            action: function ( e, dt, node, config ) {
166
            action: function ( e, dt, node, config ) {
185
                dt.search( "" ).draw("page");
167
                dt.search( "" ).draw("page");
186
                node.addClass("disabled");
168
                node.addClass("disabled");
187
            }
169
            }
170
        },
171
        {
172
            extend: 'csvHtml5',
173
            text: _("CSV"),
174
            exportOptions: {
175
                columns: exportColumns,
176
                format: export_format
177
            },
178
        },
179
        {
180
            extend: 'copyHtml5',
181
            text: _("Copy"),
182
            exportOptions: {
183
                columns: exportColumns,
184
                format: export_format
185
            },
186
        },
187
        {
188
            extend: 'print',
189
            text: _("Print"),
190
            exportOptions: {
191
                columns: exportColumns,
192
                format: export_format
193
            },
188
        }
194
        }
189
    );
195
    ];
190
196
191
    // Retrieving bKohaColumnsUseNames from the options passed to the constructor, not DT's settings
197
    // Retrieving bKohaColumnsUseNames from the options passed to the constructor, not DT's settings
192
    // But ideally should be retrieved using table.data()
198
    // But ideally should be retrieved using table.data()
Lines 222-239 function _dt_buttons(params){ Link Here
222
        );
228
        );
223
    }
229
    }
224
230
225
    buttons.push(
226
        {
227
            extend: 'collection',
228
            autoClose: true,
229
            fade: 100,
230
            className: "export_controls",
231
            titleAttr: __("Export or print"),
232
            text: '<i class="fa fa-lg fa-download"></i> <span class="dt-button-text">' + __("Export") + '</span>',
233
            buttons: export_buttons
234
        }
235
    );
236
237
    return buttons;
231
    return buttons;
238
}
232
}
239
233
240
- 

Return to bug 26553