From 767103fb70a9a42d36ce3b6c103da16c4ecad35a Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 26 Jan 2012 13:30:53 -0600 Subject: [PATCH] remove logout bug from bulk pet page --- config/assets.yml | 2 ++ public/javascripts/ajax_auth.js | 9 +++++++++ public/javascripts/outfits/edit.js | 12 ------------ 3 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 public/javascripts/ajax_auth.js diff --git a/config/assets.yml b/config/assets.yml index e26dd7e6..ed14601b 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -3,10 +3,12 @@ embed_assets: on javascripts: bulk_pets_package: + - public/javascripts/ajax_auth.js - public/javascripts/pet_query.js - public/javascripts/pets/bulk.js edit_outfit_package: + - public/javascripts/ajax_auth.js - public/javascripts/jquery.jgrowl.js - public/javascripts/wardrobe.js - public/javascripts/outfits/edit.js diff --git a/public/javascripts/ajax_auth.js b/public/javascripts/ajax_auth.js new file mode 100644 index 00000000..50b7c062 --- /dev/null +++ b/public/javascripts/ajax_auth.js @@ -0,0 +1,9 @@ +(function () { + var csrf_param = $('meta[name=csrf-param]').attr('content'), + csrf_token = $('meta[name=csrf-token]').attr('content'), + data = {}; + + data[csrf_param] = csrf_token; + + $.ajaxSetup({data: data}); +})(); diff --git a/public/javascripts/outfits/edit.js b/public/javascripts/outfits/edit.js index 2a1a0ce1..b6d8009c 100644 --- a/public/javascripts/outfits/edit.js +++ b/public/javascripts/outfits/edit.js @@ -1,15 +1,3 @@ -(function () { - var csrf_param = $('meta[name=csrf-param]').attr('content'), - csrf_token = $('meta[name=csrf-token]').attr('content'), - data = {}; - - data[csrf_param] = csrf_token; - - $.ajaxSetup({ - data: data - }); -})(); - $.fn.notify = function () { return this.stop(true, true).show('slow').delay(5000).hide('fast'); }