Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for the paths for the AJAX calls in the admin - it will now work …

…regardless of where it's mounted as a slice (and will work standalone too)
  • Loading branch information...
commit 1af3b91859ce1923536d46246e37b05ff69aa322 1 parent 56e3960
El Draper authored
Showing with 11 additions and 8 deletions.
  1. +3 −0  app/views/layout/admin.html.erb
  2. +8 −8 public/javascripts/admin.js
View
3  app/views/layout/admin.html.erb
@@ -5,6 +5,9 @@
<title>Feather - Admin</title>
<%= css_include :admin %>
<%= js_include :prototype, :effects, :admin, :application %>
+ <script type="text/javascript">
+ var ADMIN_ROOT = "<%= url(:admin_dashboard).gsub('/dashboard', '') %>";
+ </script>
</head>
<body>
<div id="header">
View
16 public/javascripts/admin.js
@@ -110,13 +110,13 @@ var FormHelper = {
Event.observe(window, 'load', function() {
//Set up the events for the configuration page
- FormHelper.inPlaceEditEvents("configuration-title", "/admin/configuration?title=");
- FormHelper.inPlaceEditEvents("configuration-tag-line", "/admin/configuration?tag_line=");
- FormHelper.inPlaceEditEvents("configuration-permalink-format", "/admin/configuration?permalink_format=");
- FormHelper.inPlaceEditEvents("configuration-about", "/admin/configuration?about=", true);
- FormHelper.inPlaceDropDownEvents("configuration-about-formatter", "/admin/configuration?about_formatter=");
+ FormHelper.inPlaceEditEvents("configuration-title", ADMIN_ROOT + "/configuration?title=");
+ FormHelper.inPlaceEditEvents("configuration-tag-line", ADMIN_ROOT + "/configuration?tag_line=");
+ FormHelper.inPlaceEditEvents("configuration-permalink-format", ADMIN_ROOT + "/configuration?permalink_format=");
+ FormHelper.inPlaceEditEvents("configuration-about", ADMIN_ROOT + "/configuration?about=", true);
+ FormHelper.inPlaceDropDownEvents("configuration-about-formatter", ADMIN_ROOT + "/configuration?about_formatter=");
Event.observe("configuration-clear-cache", "click", function() {
- new Ajax.Request("/admin/configuration", {
+ new Ajax.Request(ADMIN_ROOT + "/configuration", {
asynchronous:'true',
evalScripts:'true',
method:'put',
@@ -131,7 +131,7 @@ Event.observe(window, 'load', function() {
var Plugins = {
activate: function(id) {
- new Ajax.Request("/admin/plugins/" + id + "?active=true", {
+ new Ajax.Request(ADMIN_ROOT + "/plugins/" + id + "?active=true", {
asynchronous:'true',
evalScripts:'true',
method:'put',
@@ -144,7 +144,7 @@ var Plugins = {
},
deactivate: function(id) {
- new Ajax.Request("/admin/plugins/" + id + "?active=false", {
+ new Ajax.Request(ADMIN_ROOT + "/plugins/" + id + "?active=false", {
asynchronous:'true',
evalScripts:'true',
method:'put',
Please sign in to comment.
Something went wrong with that request. Please try again.