diff options
Diffstat (limited to 'horizon')
8 files changed, 14 insertions, 14 deletions
diff --git a/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js b/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js index e6df46c0c..64c46cb51 100644 --- a/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js +++ b/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js @@ -29,7 +29,7 @@ return directive; function link($scope, element, attrs, ngModel) { - element.bind('change', function (event) { + element.on('change', function (event) { var files = event.target.files; var file = files[0]; ngModel.$setViewValue(file); diff --git a/horizon/static/horizon/js/horizon.d3linechart.js b/horizon/static/horizon/js/horizon.d3linechart.js index f01b81992..d2dba8202 100644 --- a/horizon/static/horizon/js/horizon.d3linechart.js +++ b/horizon/static/horizon/js/horizon.d3linechart.js @@ -755,7 +755,7 @@ horizon.d3_line_chart = { * @param settings An object containing settings of the chart. */ var delegate_event_and_refresh_charts = function(selector, event_name, settings) { - $('form').delegate(selector, event_name, function() { + $('form').on(selector, event_name, function() { /* Registering 'any event' on form element by delegating. This way it can be easily overridden / enhanced when some special functionality diff --git a/horizon/static/horizon/js/horizon.forms.js b/horizon/static/horizon/js/horizon.forms.js index 8fff1d0f5..00e41478e 100644 --- a/horizon/static/horizon/js/horizon.forms.js +++ b/horizon/static/horizon/js/horizon.forms.js @@ -168,11 +168,11 @@ horizon.forms = { endDate.hide(); }).data('datepicker'); - $("#id_start").mousedown(function(){ + $("#id_start").on("mousedown", function() { endDate.hide(); }); - $("#id_end").mousedown(function(){ + $("#id_end").on("mousedown", function() { startDate.hide(); }); @@ -184,12 +184,12 @@ horizon.forms = { horizon.forms.handle_submit = function (el) { var $form = $(el).find("form"); - $form.submit(function () { + $form.on('submit', function () { var $this = $(this); // Disable multiple submissions when launching a form. var button = $this.find('[type="submit"]'); if (button.hasClass('btn-primary') && !button.hasClass('always-enabled')){ - $this.submit(function () { + $this.on('submit', function () { return false; }); button.removeClass('primary').addClass('disabled'); diff --git a/horizon/static/horizon/js/horizon.hacks.js b/horizon/static/horizon/js/horizon.hacks.js index d1db9fa93..6df69894b 100644 --- a/horizon/static/horizon/js/horizon.hacks.js +++ b/horizon/static/horizon/js/horizon.hacks.js @@ -15,7 +15,7 @@ // Added so that we can break Firefox and Safari bfcache to // prevent loading previous page from cache. horizon.addInitFunction(function () { - $(window).bind('pageshow', function(event) { + $(window).on('pageshow', function(event) { if (event.originalEvent.persisted) { window.location.reload(); } diff --git a/horizon/static/horizon/js/horizon.membership.js b/horizon/static/horizon/js/horizon.membership.js index 8253d554c..678e109f6 100644 --- a/horizon/static/horizon/js/horizon.membership.js +++ b/horizon/static/horizon/js/horizon.membership.js @@ -415,7 +415,7 @@ horizon.membership = { **/ list_filtering: function (step_slug) { // remove previous lists' quicksearch events - $('input.' + step_slug + '_filter').unbind(); + $('input.' + step_slug + '_filter').off(); // set up quicksearch to filter on input $('.' + step_slug + '_filterable').each(function () { @@ -490,7 +490,7 @@ horizon.membership = { } // prevent filter inputs from submitting form on 'enter' - $form.find('.' + step_slug + '_membership').keydown(function(event){ + $form.find('.' + step_slug + '_membership').on('keydown', function(event){ if (event.keyCode === 13) { event.preventDefault(); return false; diff --git a/horizon/static/horizon/js/horizon.messages.js b/horizon/static/horizon/js/horizon.messages.js index 94d654efe..2e8484585 100644 --- a/horizon/static/horizon/js/horizon.messages.js +++ b/horizon/static/horizon/js/horizon.messages.js @@ -93,14 +93,14 @@ horizon.autoDismissAlert = function ($alert) { horizon.addInitFunction(function () { // Bind AJAX message handling. $(document).ajaxComplete(function(event, request){ - var message_array = $.parseJSON(horizon.ajax.get_messages(request)); + var message_array = JSON.parse(horizon.ajax.get_messages(request)); $(message_array).each(function (index, item) { horizon.alert(item[0], item[1], item[2]); }); }); // Dismiss alert messages when moving on to a new type of action. - $('a.ajax-modal').click(function() { + $('a.ajax-modal').on('click', function() { horizon.clearAllMessages(); }); diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js index b31a9bbf9..a7d5cb4b4 100644 --- a/horizon/static/horizon/js/horizon.modals.js +++ b/horizon/static/horizon/js/horizon.modals.js @@ -346,7 +346,7 @@ horizon.addInitFunction(horizon.modals.init = function() { } else if (redirect_header) { location.href = redirect_header; } else if (add_to_field_header) { - json_data = $.parseJSON(data); + json_data = JSON.parse(data); field_to_update = $("#" + add_to_field_header); field_to_update.append("<option value='" + json_data[0] + "'>" + json_data[1] + "</option>"); field_to_update.change(); @@ -417,7 +417,7 @@ horizon.addInitFunction(horizon.modals.init = function() { // Position modal so it's in-view even when scrolled down. $document.on('show.bs.modal', '.modal', function (evt) { // avoid closing the modal when escape is pressed on a select input - $("select", evt.target).keyup(function (e) { + $("select", evt.target).on('keyup', function (e) { if (e.keyCode === 27) { // remove the focus on the select, so double escape close the modal e.target.blur(); diff --git a/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js b/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js index 9678b51f8..3978af5f3 100644 --- a/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js +++ b/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js @@ -38,7 +38,7 @@ var bootstrapWizardCreate = function(element, options) { this.rebindClick = function(selector, fn) { - selector.unbind('click', fn).bind('click', fn); + selector.off('click', fn).bind('click', fn); } this.fixNavigationButtons = function() { |