From ccb304c7ef00da13c5813544ce5ef7a61e898089 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Tue, 11 Jan 2011 18:09:42 -0500 Subject: [PATCH] [#257] cleanup of if/else --- plugins/googlemap/popcorn.googlemap.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/googlemap/popcorn.googlemap.js b/plugins/googlemap/popcorn.googlemap.js index b275654..80581d8 100644 --- a/plugins/googlemap/popcorn.googlemap.js +++ b/plugins/googlemap/popcorn.googlemap.js @@ -126,13 +126,13 @@ var googleCallback; options._map.getDiv().style.display = 'block'; // reset the location and zoom just in case the user plaid with the map options._map.setCenter(options._location); - if ( options.zoom ) { - if ( typeof options.zoom !== "number" ) { - options.zoom = +options.zoom; - } - } else { - options.zoom = 0; + + // make sure options.zoom is a number + if ( options.zoom && isNaN( options.zoom ) ) { + options.zoom = +options.zoom; } + options.zoom = options.zoom || 0; // default to 0 + options._map.setZoom( options.zoom ); } }; -- 2.43.0