From 6cbddce45983570f1dc886a23a8992ae14a52687 Mon Sep 17 00:00:00 2001 From: kbparagua Date: Mon, 1 Apr 2013 22:27:43 +0800 Subject: [PATCH] Bug Fix: prevent javascript error when callback doesn't exist. --- Changelog.md | 4 ++++ paloma.gemspec | 2 +- vendor/assets/javascripts/paloma_core.js | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index d068482..fe32e66 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,10 @@ Changelog = +Version 2.0.3 +- +* Bug Fix: prevent javascript error when callback doesn't exist. + Version 2.0.2 - * 'js(false)' will prevent Paloma from appending _callback_hook on the response. diff --git a/paloma.gemspec b/paloma.gemspec index f8a39f8..821ac1a 100644 --- a/paloma.gemspec +++ b/paloma.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'paloma' - s.version = '2.0.2' + s.version = '2.0.3' s.summary = "Provides an easy way to execute page-specific javascript for Rails." s.description = "Page-specific javascript for Rails done right" s.authors = ["Karl Paragua", "Bia Esmero"] diff --git a/vendor/assets/javascripts/paloma_core.js b/vendor/assets/javascripts/paloma_core.js index 81aeb79..06b9cd5 100644 --- a/vendor/assets/javascripts/paloma_core.js +++ b/vendor/assets/javascripts/paloma_core.js @@ -199,9 +199,11 @@ Paloma.execute = function(controller, action, params){ var callback = Paloma.callbacks[controller]; callbackFound = callback != undefined; - callback = callback[action]; - callbackFound = callback != undefined; - + if (callbackFound){ + callback = callback[action]; + callbackFound = callback != undefined; + } + // Parse parameters params = params || {};