mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Renamed #sitetree_ul to .cms-tree in JavaScript logic (changed in LeftAndMain.ss base template)
This commit is contained in:
parent
8bee7a1290
commit
d48f21afc0
@ -10,7 +10,7 @@
|
|||||||
$('.AssetTableField.dragdrop').entwine({
|
$('.AssetTableField.dragdrop').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
$('#sitetree li').each(function() {
|
$('.cms-tree li').each(function() {
|
||||||
$(this).droppable({
|
$(this).droppable({
|
||||||
greedy: true,
|
greedy: true,
|
||||||
hoverClass: 'over', // same hover effect as normal tree
|
hoverClass: 'over', // same hover effect as normal tree
|
||||||
|
@ -44,13 +44,13 @@
|
|||||||
success: function() {
|
success: function() {
|
||||||
button.removeClass('loading');
|
button.removeClass('loading');
|
||||||
// reload current form and tree
|
// reload current form and tree
|
||||||
var currNode = $('#sitetree')[0].firstSelected();
|
var currNode = $('.cms-tree')[0].firstSelected();
|
||||||
if(currNode) {
|
if(currNode) {
|
||||||
var url = $(currNode).find('a').attr('href');
|
var url = $(currNode).find('a').attr('href');
|
||||||
$('.cms-edit-form').loadForm(url);
|
$('.cms-edit-form').loadForm(url);
|
||||||
}
|
}
|
||||||
$('#sitetree')[0].setCustomURL('admin/assets/getsubtree');
|
$('.cms-tree')[0].setCustomURL('admin/assets/getsubtree');
|
||||||
$('#sitetree')[0].reload({onSuccess: function() {
|
$('.cms-tree')[0].reload({onSuccess: function() {
|
||||||
// TODO Reset current tree node
|
// TODO Reset current tree node
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@
|
|||||||
_reloadSitetree: function(params) {
|
_reloadSitetree: function(params) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
$('#sitetree').search(
|
$('.cms-tree').search(
|
||||||
params,
|
params,
|
||||||
function() {
|
function() {
|
||||||
self.find(':submit').attr('disabled', false).removeClass('loading');
|
self.find(':submit').attr('disabled', false).removeClass('loading');
|
||||||
@ -184,7 +184,7 @@
|
|||||||
|
|
||||||
// integrate with sitetree selection changes
|
// integrate with sitetree selection changes
|
||||||
// TODO Only trigger when report is visible
|
// TODO Only trigger when report is visible
|
||||||
jQuery('#sitetree').bind('select_node.jstree', function(e, data) {
|
jQuery('.cms-tree').bind('select_node.jstree', function(e, data) {
|
||||||
var node = data.rslt.obj;
|
var node = data.rslt.obj;
|
||||||
self.find(':input[name=ID]').val(node ? $(node).data('id') : null);
|
self.find(':input[name=ID]').val(node ? $(node).data('id') : null);
|
||||||
self.trigger('submit');
|
self.trigger('submit');
|
||||||
@ -306,7 +306,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// integrate with sitetree selection changes
|
// integrate with sitetree selection changes
|
||||||
jQuery('#sitetree').bind('select_node.jstree', function(e, data) {
|
jQuery('.cms-tree').bind('select_node.jstree', function(e, data) {
|
||||||
var node = data.rslt.obj;
|
var node = data.rslt.obj;
|
||||||
self.find(':input[name=ID]').val(node ? $(node).data('id') : null);
|
self.find(':input[name=ID]').val(node ? $(node).data('id') : null);
|
||||||
if(self.is(':visible')) self.trigger('submit');
|
if(self.is(':visible')) self.trigger('submit');
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
(function($) {
|
(function($) {
|
||||||
$.entwine('ss', function($){
|
$.entwine('ss', function($){
|
||||||
/**
|
/**
|
||||||
* Class: #sitetree
|
* Class: .cms-tree
|
||||||
*
|
*
|
||||||
* Tree panel.
|
* Tree panel.
|
||||||
*/
|
*/
|
||||||
$('#sitetree').entwine({
|
$('.cms-tree').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
// make sure current ID of loaded form is actually selected in tree
|
// make sure current ID of loaded form is actually selected in tree
|
||||||
var id = $('.cms-edit-form :input[name=ID]').val();
|
var id = $('.cms-edit-form :input[name=ID]').val();
|
||||||
|
Loading…
Reference in New Issue
Block a user