Browse Source

Cleanup: replace deprecated jQuery 'bind()' method with 'on()'

Robert Zollner 6 years ago
parent
commit
abe14f8685

+ 3 - 3
web/js/init.js

@@ -11,7 +11,7 @@ $(document).ready(function(){
         var selectedOption = $(this).find(":selected").text();
         $(this).next(".holder").text(selectedOption);
     }).trigger('change');
-    $('.to-top').bind('click', function(evt) {
+    $('.to-top').on('click', function(evt) {
         $("html, body").animate({ scrollTop: 0 }, "normal");
     });
 
@@ -202,7 +202,7 @@ $(document).ready(function(){
                   }
               );
 
-              $(window).bind('keypress', function(evt) {
+              $(window).on('keypress', function(evt) {
                   var tag = evt.target.tagName.toLowerCase();
                   if (evt.charCode == 97 && tag != 'input' && tag != 'textarea' && tag != 'selectbox') {
                       evt.preventDefault();
@@ -596,7 +596,7 @@ $(document).ready(function(){
             }
 
             // 
-            $('form#objects').bind('submit', function(evt) {
+            $('form#objects').on('submit', function(evt) {
                 $('.l-unit').find('.ch-toggle').prop('checked', false);
                 $('.l-unit.selected').find('.ch-toggle').prop('checked', true);
             });

+ 1 - 1
web/js/iviewer/test/lightbox-gallery/main.js

@@ -60,7 +60,7 @@
         close();
     });
 
-    $("#iviewer").bind('fadein', function() {
+    $("#iviewer").on('fadein', function() {
         $(window).keydown(function(e) {
             if (e.which == 27) close();
         });

+ 1 - 1
web/js/iviewer/test/lightbox/main.js

@@ -49,7 +49,7 @@
         close();
     });
 
-    $("#iviewer").bind('fadein', function() {
+    $("#iviewer").on('fadein', function() {
         $(window).keydown(function(e) {
             if (e.which == 27) close();
         });

+ 1 - 1
web/js/pages/add_mail_acc.js

@@ -66,7 +66,7 @@ App.Helpers.isUnlimitedValue = function(value) {
 // Trigger listeners
 App.Listeners.MAIL_ACC.init();
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature();
-$('form[name="v_quota"]').bind('submit', function(evt) {
+$('form[name="v_quota"]').on('submit', function(evt) {
     $('input:disabled').each(function(i, elm) {
         $(elm).attr('disabled', false);
         if (App.Helpers.isUnlimitedValue($(elm).val())) {

+ 1 - 1
web/js/pages/add_package.js

@@ -67,7 +67,7 @@ App.Helpers.isUnlimitedValue = function(value) {
 // Trigger listeners
 App.Listeners.PACKAGE.init();
 App.Listeners.PACKAGE.checkbox_unlimited_feature();
-$('form[name="v_add_package"]').bind('submit', function(evt) {
+$('form[name="v_add_package"]').on('submit', function(evt) {
     $('input:disabled').each(function(i, elm) {
         $(elm).attr('disabled', false);
         if (App.Helpers.isUnlimitedValue($(elm).val())) {

+ 1 - 1
web/js/pages/add_web.js

@@ -211,7 +211,7 @@ function FTPrandom(elm) {
     $(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
 }
 
-$('#vstobjects').bind('submit', function(evt) {
+$('#vstobjects').on('submit', function(evt) {
     $('input[disabled]').each(function(i, elm) {
         $(elm).removeAttr('disabled');
     });

+ 1 - 1
web/js/pages/edit_mail.js

@@ -26,7 +26,7 @@ function elementHideShow(elementToHideOrShow){
     el.style.display = el.style.display === 'none' ? 'block' : 'none';
 }
 
-$('#vstobjects').bind('submit', function(evt) {
+$('#vstobjects').on('submit', function(evt) {
     $('input[disabled]').each(function(i, elm) {
         var copy_elm = $(elm).clone(true);
         $(copy_elm).attr('type', 'hidden');

+ 1 - 1
web/js/pages/edit_mail_acc.js

@@ -67,7 +67,7 @@ App.Helpers.isUnlimitedValue = function(value) {
 // Trigger listeners
 App.Listeners.MAIL_ACC.init();
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature();
-$('form[name="v_quota"]').bind('submit', function(evt) {
+$('form[name="v_quota"]').on('submit', function(evt) {
     $('input:disabled').each(function(i, elm) {
         $(elm).attr('disabled', false);
         if (App.Helpers.isUnlimitedValue($(elm).val())) {

+ 1 - 1
web/js/pages/edit_package.js

@@ -67,7 +67,7 @@ App.Helpers.isUnlimitedValue = function(value) {
 // Trigger listeners
 App.Listeners.PACKAGE.init();
 App.Listeners.PACKAGE.checkbox_unlimited_feature();
-$('form[name="v_edit_package"]').bind('submit', function(evt) {
+$('form[name="v_edit_package"]').on('submit', function(evt) {
     $('input:disabled').each(function(i, elm) {
         $(elm).attr('disabled', false);
         if (App.Helpers.isUnlimitedValue($(elm).val())) {

+ 1 - 1
web/js/pages/edit_web.js

@@ -192,7 +192,7 @@ $(function() {
         }
     });
 
-    $('#vstobjects').bind('submit', function(evt) {
+    $('#vstobjects').on('submit', function(evt) {
         $('input[disabled]').each(function(i, elm) {
             var copy_elm = $(elm).clone(true);
             $(copy_elm).attr('type', 'hidden');