MINOR Replaced hardcoded URLs in LeftAndMain.Tree.js with data-url-* attributes

This commit is contained in:
Ingo Schommer 2011-03-10 16:13:43 +13:00
parent 018830e9e8
commit d22e80b1bd
6 changed files with 6 additions and 18 deletions

View File

@ -15,7 +15,7 @@
// TODO Hack to avoid ajax load on init, see http://code.google.com/p/jstree/issues/detail?id=911
'data': treeContainer.html(),
'ajax': {
'url': 'admin/getsubtree',
'url': treeContainer.data('url-tree'),
'data': function(node) {
return { ID : $(node).data("id") ? $(node).data("id") : 0 , ajax: 1};
}
@ -82,7 +82,7 @@
});
$.ajax({
'url': 'admin/savetreenode',
'url': treeContainer.data('url-savetreenode'),
'data': {
ID: $(movedNode).data('id'),
ParentID: $(newParentNode).data('id') || 0,

View File

@ -1,12 +0,0 @@
/**
* File: SecurityAdmin.Tree.js
*
* Configuration for the left hand tree
*/
if(typeof SiteTreeHandlers == 'undefined') SiteTreeHandlers = {};
SiteTreeHandlers.parentChanged_url = 'admin/security/ajaxupdateparent';
SiteTreeHandlers.orderChanged_url = 'admin/security/ajaxupdatesort';
SiteTreeHandlers.loadPage_url = 'admin/security/getitem';
SiteTreeHandlers.loadTree_url = 'admin/security/getsubtree';
SiteTreeHandlers.showRecord_url = 'admin/security/show/';
SiteTreeHandlers.controller_url = 'admin/security';

View File

@ -36,7 +36,7 @@
</label>
</div>
<div id="sitetree_ul">
<div id="sitetree_ul" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)">
$SiteTreeAsUL
</div>

View File

@ -7,7 +7,7 @@
<div id="TreeTools">
<% include CMSMain_TreeTools %>
</div>
<div id="sitetree_ul">
<div id="sitetree_ul" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)">
$SiteTreeAsUL
</div>
</div>

View File

@ -10,7 +10,7 @@
</h3>
<div id="sitetree_holder">
<div id="sitetree_and_tools">
<div id="sitetree_ul">
<div id="sitetree_ul" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)">
<% include ReportAdmin_SiteTree %>
</div>
</div>

View File

@ -36,7 +36,7 @@
</label>
</div>
<div id="sitetree_ul">
<div id="sitetree_ul" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)">
$SiteTreeAsUL
</div>