Made the embed widget automatically generate URLs based on the ADMIN_URL global,...
authorHarris Lapiroff <hlapirof@oberlin.edu>
Mon, 13 Jun 2011 18:40:06 +0000 (14:40 -0400)
committerHarris Lapiroff <hlapirof@oberlin.edu>
Mon, 13 Jun 2011 18:40:06 +0000 (14:40 -0400)
philo/static/philo/js/EmbedWidget.js

index 0f972e4..bcb9f5f 100644 (file)
@@ -94,8 +94,8 @@
                        object_name = val.split('.')[1];
                        
                        // generate the url
-                       // TODO: abstract this so it can calculate the admin url dynamically
-                       href=["/admin", app_label, object_name, '?pop=1'].join('/');
+                       // TODO: Find a better way to get ADMIN_URL. Currently this only works with grappelli, which provides the javascript global ADMIN_URL
+                       href=[ADMIN_URL, app_label,  '/', object_name, '/?pop=1'].join('');
                        
                        // this is a bit hackish. let's walk through it.
                        // TODO: best to write our own template for this in the future