aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-10-22 18:16:24 -0200
committerSilvio <silvio@devlet.com.br>2010-10-22 18:16:24 -0200
commitf4e139e0e1673352ff4fc397f64b575df9a65a56 (patch)
tree6bed2cfe7ded7a4276642a7f212907fa04dfe74e
parent98861aed94de26f4c55f8b450a8ff3a657e4feb6 (diff)
downloadjquery_gallery_view-f4e139e0e1673352ff4fc397f64b575df9a65a56.tar.gz
jquery_gallery_view-f4e139e0e1673352ff4fc397f64b575df9a65a56.tar.bz2
Adding jquery_gallery_view_load()
-rw-r--r--jquery_gallery_view.module16
-rw-r--r--js/jquery_gallery_view.js2
2 files changed, 12 insertions, 6 deletions
diff --git a/jquery_gallery_view.module b/jquery_gallery_view.module
index 3faec25..4799101 100644
--- a/jquery_gallery_view.module
+++ b/jquery_gallery_view.module
@@ -13,7 +13,7 @@
* View data.
*/
function jquery_gallery_view_setup_photos($view, $field) {
- // Setup files folder
+ // Setup files folder.
$files = variable_get('file_directory_path', conf_path() .'/files');
foreach ($view->result as $result) {
@@ -28,9 +28,15 @@ function jquery_gallery_view_setup_photos($view, $field) {
}
}
- // Add needed javascript
+ // Add needed javascript.
drupal_add_js(array('jqueryGalleryView' => array('photos' => $photos)), 'setting');
- drupal_add_js(drupal_get_path('module', 'jquery_gallery_view') .'/js/jquery-galleryview.js');
- drupal_add_js(drupal_get_path('module', 'jquery_gallery_view') .'/js/jquery-galleryview/jquery.galleryview-2.1.1-pack.js');
- drupal_add_js(drupal_get_path('module', 'jquery_gallery_view') .'/js/jquery-galleryview/jquery.timers-1.2.js');
+}
+
+/**
+ * Load needed javascript files.
+ */
+function jquery_gallery_view_load() {
+ drupal_add_js(drupal_get_path('module', 'jquery_gallery_view') .'/js/jquery_gallery_view.js');
+ drupal_add_js(drupal_get_path('module', 'jquery_gallery_view') .'/js/galleryview/jquery.galleryview-2.1.1-pack.js');
+ drupal_add_js(drupal_get_path('module', 'jquery_gallery_view') .'/js/galleryview/jquery.timers-1.2.js');
}
diff --git a/js/jquery_gallery_view.js b/js/jquery_gallery_view.js
index 8ac3219..032c8e0 100644
--- a/js/jquery_gallery_view.js
+++ b/js/jquery_gallery_view.js
@@ -5,7 +5,7 @@ Drupal.behaviors.jqueryGalleryViewBehavior = function (context) {
$('.views-field-title').attr('class', 'views-field-site-title');
// Add photos
- if (Drupal.settings.jqueryGalleryView.photos != null) {
+ if (Drupal.settings.jqueryGalleryView != null && Drupal.settings.jqueryGalleryView.photos != null) {
var photos = Drupal.settings.jqueryGalleryView.photos;
// Image sizes