Author: ornicar2
Date: 2010-01-19 14:13:10 +0100 (Tue, 19 Jan 2010)
New Revision: 26877

Modified:
   plugins/dmWidgetGalleryPlugin/lib/dmWidgetContentGalleryView.php
   plugins/dmWidgetGalleryPlugin/web/js/view.js
Log:
[Diem][dmWidgetGalleryPlugin]
- fixed gallery loading during widget edition
- fixed front widget cache

Modified: plugins/dmWidgetGalleryPlugin/lib/dmWidgetContentGalleryView.php
===================================================================
--- plugins/dmWidgetGalleryPlugin/lib/dmWidgetContentGalleryView.php    
2010-01-19 13:12:37 UTC (rev 26876)
+++ plugins/dmWidgetGalleryPlugin/lib/dmWidgetContentGalleryView.php    
2010-01-19 13:13:10 UTC (rev 26877)
@@ -112,6 +112,11 @@
     
     $html .= '</ol>';
     
+    if ($this->isCachable())
+    {
+      $this->setCache($html);
+    }
+    
     return $html;
   }
   

Modified: plugins/dmWidgetGalleryPlugin/web/js/view.js
===================================================================
--- plugins/dmWidgetGalleryPlugin/web/js/view.js        2010-01-19 13:12:37 UTC 
(rev 26876)
+++ plugins/dmWidgetGalleryPlugin/web/js/view.js        2010-01-19 13:13:10 UTC 
(rev 26877)
@@ -5,35 +5,37 @@
     var $gallery = $(this).find('ol.dm_widget_content_gallery');
 
     // only if elements in gallery
-    if ($gallery.find('>li').length)
+    if(!$gallery.find('>li').length)
     {
-      // get options from gallery metadata
-      var options = $gallery.metadata();
+      return;
+    }
 
-      if (options.animation == 'slideshow')
+    // get options from gallery metadata
+    var options = $gallery.metadata();
+
+    if (options.animation == 'slideshow')
+    {
+      // launch jQuery cycle
+      $gallery.cycle({
+        timeout:     options.delay * 1000,                      // convert to 
ms
+        height:      $gallery.find('img:first').attr('height')  // use first 
image height
+      });
+    }
+    else if(options.animation == 'custom')
+    {
+      if ($.isFunction($.dm.customGallery))
       {
-        // launch jQuery cycle
-        $gallery.cycle({
-          timeout:     options.delay * 1000,                      // convert 
to ms
-          height:      $gallery.find('img:first').attr('height')  // use first 
image height
-        });
+        $.dm.customGallery($gallery, options);
       }
-      else if(options.animation == 'custom')
-      {
-        if ($.isFunction($.dm.customGallery))
-        {
-          $.dm.customGallery($gallery, options);
-        }
-        else
-        {
-          alert('You must create a $.dm.customGallery(element, options) 
function in your front.js to use custom animation');
-        }
-      }
       else
       {
-        alert('Unknown animation '+options.animation);
+        alert('You must create a $.dm.customGallery(element, options) function 
in your front.js to use custom animation');
       }
     }
+    else
+    {
+      alert('Unknown animation '+options.animation);
+    }
   });
 
 })(jQuery);
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.


Reply via email to