mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 08:25:00 -04:00
jQuery: Migrate to .on()
, .off()
, .trigger()
This avoids methods that are deprecated in newer versions of jQuery.
This commit is contained in:
parent
2f5b6b80e1
commit
d5b981719f
47 changed files with 195 additions and 195 deletions
|
@ -112,15 +112,15 @@ $(document).ready(() => {
|
|||
|
||||
const updateHandlers = () => {
|
||||
// Search
|
||||
$('#search-query').unbind('keyup').keyup(() => {
|
||||
$('#search-query').off('keyup').on('keyup', () => {
|
||||
search($('#search-query').val());
|
||||
});
|
||||
|
||||
// Prevent form submit
|
||||
$('#search-query').parent().bind('submit', () => false);
|
||||
$('#search-query').parent().on('submit', () => false);
|
||||
|
||||
// update & install
|
||||
$('.do-install, .do-update').unbind('click').click(function (e) {
|
||||
$('.do-install, .do-update').off('click').on('click', function (e) {
|
||||
const $row = $(e.target).closest('tr');
|
||||
const plugin = $row.data('plugin');
|
||||
if ($(this).hasClass('do-install')) {
|
||||
|
@ -134,7 +134,7 @@ $(document).ready(() => {
|
|||
});
|
||||
|
||||
// uninstall
|
||||
$('.do-uninstall').unbind('click').click((e) => {
|
||||
$('.do-uninstall').off('click').on('click', (e) => {
|
||||
const $row = $(e.target).closest('tr');
|
||||
const pluginName = $row.data('plugin');
|
||||
socket.emit('uninstall', pluginName);
|
||||
|
@ -143,14 +143,14 @@ $(document).ready(() => {
|
|||
});
|
||||
|
||||
// Sort
|
||||
$('.sort.up').unbind('click').click(function () {
|
||||
$('.sort.up').off('click').on('click', function () {
|
||||
search.sortBy = $(this).attr('data-label').toLowerCase();
|
||||
search.sortDir = false;
|
||||
search.offset = 0;
|
||||
search(search.searchTerm, search.results.length);
|
||||
search.results = [];
|
||||
});
|
||||
$('.sort.down, .sort.none').unbind('click').click(function () {
|
||||
$('.sort.down, .sort.none').off('click').on('click', function () {
|
||||
search.sortBy = $(this).attr('data-label').toLowerCase();
|
||||
search.sortDir = true;
|
||||
search.offset = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue