Project

General

Profile

« Previous | Next » 

Revision 77e12c85

Added by Tomer Brisker almost 8 years ago

Fixes #13047, #16291 - Upgrade datatables and move it to npm

View differences:

app/assets/javascripts/application.js
title: function(){return (this.scrollWidth > this.clientWidth) ? this.textContent : null;}
});
$('*[title]').not('*[rel]').tooltip({ container: 'body' });
activateDatatables();
tfm.tools.activateDatatables();
// Prevents all links with the disabled attribute set to "disabled"
// from being clicked.
......
$(this).html(response);
}
if ($(this).data('on-complete')){
window[$(this).data('on-complete')].call(null, this, status);
_.get(window, $(this).data('on-complete')).call(null, this, status);
}
});
});
......
})
}
function activateDatatables() {
$('[data-table=inline]').not('.dataTable').dataTable(
{
"sDom": "<'row'<'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
"sPaginationType": "bootstrap"
}
);
$('[data-table=server]').not('.dataTable').each(function () {
var url = $(this).data('source');
$(this).dataTable(
{
"bProcessing": true,
"bServerSide": true,
"bSort": false,
"sAjaxSource": url,
"sDom": "<'row'<'col-md-6'f>r>t<'row'<'col-md-6'><'col-md-6'p>>",
"sPaginationType": "bootstrap"
}
);
});
}
function preserve_selected_options(elem) {
// mark the selected values to preserve them for form hiding
elem.find('option:not(:selected)').removeAttr('selected');

Also available in: Unified diff