Skip to content
This repository
  • 2 commits
  • 1 file changed
  • 0 comments
  • 2 contributors
Mar 01, 2012
Christian Vuerings SAKIII-5122 - Fix render of collectionviewer 2591828
Nicolaas Matthijs Merge branch 'SAKIII-5122' of git://github.com/christianv/3akai-ux in…
…to SAKIII-5122

* 'SAKIII-5122' of git://github.com/christianv/3akai-ux:
  SAKIII-5122 - Fix render of collectionviewer
396ae02
12  devwidgets/collectionviewer/javascript/collectionviewer.js
@@ -614,7 +614,11 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
614 614
         var doInit = function(){
615 615
             collectionviewer.listStyle = $.bbq.getState(collectionviewer.tuidls) || 'carousel';
616 616
             collectionviewer.sortOrder = $.bbq.getState(collectionviewer.tuidso) || 'modified';
617  
-            collectionviewer.contextId = widgetData.data._path || widgetData.collectionviewer.groupid;
  617
+            if (widgetData.data && widgetData.data._path) {
  618
+                collectionviewer.contextId = widgetData.data._path;
  619
+            } else {
  620
+                collectionviewer.contextId = widgetData.collectionviewer.groupid
  621
+            }
618 622
             if(sakai.api.Content.Collections.canCurrentUserManageCollection(collectionviewer.contextId)){
619 623
                 $('#collectionviewer_header_container #collectionviewer_add_content_button', $rootel).show();
620 624
                 $('#collectionviewer_header_container #collectionviewer_edit_collection_button', $rootel).show();
@@ -625,7 +629,11 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
625 629
             $('#collectionviewer_sortby', $rootel).val(collectionviewer.sortOrder);
626 630
 
627 631
             if (sakai_global && sakai_global.content_profile && sakai_global.content_profile.content_data) {
628  
-                collectionviewer.collectionName = widgetData.data["sakai:pooled-content-file-name"] || sakai_global.content_profile.content_data.data["sakai:pooled-content-file-name"];
  632
+                if (widgetData.data && widgetData.data['sakai:pooled-content-file-name']) {
  633
+                    collectionviewer.collectionName = widgetData.data['sakai:pooled-content-file-name'];
  634
+                } else {
  635
+                    collectionviewer.collectionName = sakai_global.content_profile.content_data.data['sakai:pooled-content-file-name'];
  636
+                }
629 637
                 switchListView();
630 638
                 addBinding();
631 639
             // Retrieve the name of the collection as we're not in a content profile page

No commit comments for this range

Something went wrong with that request. Please try again.