From 62e171a4e3b504e01f9a1d6a1fb515d45ed50c6c Mon Sep 17 00:00:00 2001 From: Simon Elvery Date: Mon, 1 Oct 2012 10:49:44 +1000 Subject: [PATCH] BUGFIX Make sure it's possible to rename the module's directory without breaking things. --- _config.php | 3 +-- code/forms/GridFieldSortableRows.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/_config.php b/_config.php index 15c5adc..c94db46 100644 --- a/_config.php +++ b/_config.php @@ -1,3 +1,2 @@ \ No newline at end of file +define('SORTABLE_GRIDFIELD_BASE', Director::absoluteBaseURL() . basename(dirname(__FILE__))); \ No newline at end of file diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index c1784aa..acb7826 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -73,8 +73,8 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP //Inject Requirements - Requirements::css('SortableGridField/css/GridFieldSortableRows.css'); - Requirements::javascript('SortableGridField/javascript/GridFieldSortableRows.js'); + Requirements::css(SORTABLE_GRIDFIELD_BASE . '/css/GridFieldSortableRows.css'); + Requirements::javascript(SORTABLE_GRIDFIELD_BASE . '/javascript/GridFieldSortableRows.js'); $args = array('Colspan' => count($gridField->getColumns()), 'ID' => $gridField->ID());