diff --git a/resources/assets/js/cachet.js b/resources/assets/js/cachet.js index 990c8c1b..e063aa66 100644 --- a/resources/assets/js/cachet.js +++ b/resources/assets/js/cachet.js @@ -1,4 +1,4 @@ -$(function() { +$(function () { // Ajax Setup $.ajaxPrefilter(function(options, originalOptions, jqXHR) { var token; @@ -28,7 +28,7 @@ $(function() { }); // Prevent double form submission - $('form').submit(function() { + $('form').submit(function () { var $form = $(this); $form.find(':submit').prop('disabled', true); }); @@ -37,7 +37,7 @@ $(function() { // autosize($('textarea.autosize')); // Mock the DELETE form requests. - $('[data-method]').not(".disabled").append(function() { + $('[data-method]').not(".disabled").append(function () { var methodForm = "\n"; methodForm += "
\n"; methodForm += "\n"; @@ -46,11 +46,11 @@ $(function() { return methodForm; }) .removeAttr('href') - .on('click', function() { + .on('click', function () { var button = $(this); if (button.hasClass('confirm-action')) { - askConfirmation(function() { + askConfirmation(function () { button.find("form").submit(); }); } else { @@ -95,12 +95,12 @@ $(function() { }; }; - $(".sidebar-toggler").click(function(e) { + $(".sidebar-toggler").on('click', function (e) { e.preventDefault(); $(".wrapper").toggleClass("toggled"); }); - $('.color-code').each(function() { + $('.color-code').each(function () { var $this = $(this); $this.minicolors({ @@ -116,11 +116,11 @@ $(function() { $('[data-toggle="tooltip"]').tooltip(); - $('button.close').on('click', function() { + $('button.close').on('click', function () { $(this).parents('div.alert').addClass('hide'); }); - $('form[name=IncidentForm] select[name=component_id]').on('change', function() { + $('form[name=IncidentForm] select[name=component_id]').on('change', function () { var $option = $(this).find('option:selected'); var $componentStatus = $('#component-status'); @@ -189,7 +189,7 @@ $(function() { new Sortable(list, { group: 'omega', handle: '.drag-handle', - onUpdate: function() { + onUpdate: function () { var orderedIds = $.map(list.querySelectorAll('[data-orderable-id]'), function(elem) { return $(elem).data('orderable-id'); }); @@ -201,10 +201,10 @@ $(function() { data: { ids: orderedIds }, - success: function() { + success: function () { notifier.notify('Ordering updated.', 'success'); }, - error: function() { + error: function () { notifier.notify('Ordering not updated.', 'error'); } }); @@ -213,7 +213,7 @@ $(function() { }); // Toggle inline component statuses. - $('form.component-inline').on('click', 'input[type=radio]', function() { + $('form.component-inline').on('click', 'input[type=radio]', function () { var $form = $(this).parents('form'); var formData = $form.serializeObject(); @@ -232,7 +232,7 @@ $(function() { }); // Incident management - $('select[name=template]').on('change', function() { + $('select[name=template]').on('change', function () { var $this = $(this).find('option:selected'), slug = $this.val(); @@ -249,7 +249,7 @@ $(function() { $form.find('input[name=name]').val(tpl.name); $form.find('textarea[name=message]').val(tpl.template); }, - error: function() { + error: function () { (new Cachet.Notifier()).notify('There was an error finding that template.'); } }); @@ -257,7 +257,7 @@ $(function() { }); // Banner removal JS - $('#remove-banner').click(function(){ + $('#remove-banner').on('click', function (){ $('#banner-view').remove(); $('input[name=remove_banner]').val('1'); }); @@ -310,7 +310,7 @@ $(function() { (new Cachet.Notifier()).notify(error); }); }) - .always(function() { + .always(function () { $btn.button('reset'); });