mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX Changed sitetree default selection in LeftAndMain.Tree.js to fire on window.load instead of document.ready() through entwine. We need to ensure behaviour.js bindings are available before
BUGFIX Automatically selecting root node in CMS trees (necessary because now we actually have forms on the root node, and its a valid click target) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@99605 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
67205b01e2
commit
ae844c5386
@ -17,18 +17,14 @@ var _HANDLER_FORMS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
/**
|
$(window).bind('load', function(e) {
|
||||||
* @class Tree panel.
|
// behaviour.js load handlers need to be fired before this event, so we artificially delay it
|
||||||
* @name ss.sitetree
|
setTimeout(function() {
|
||||||
*/
|
|
||||||
$('#sitetree').concrete('ss', function($){
|
|
||||||
return/** @lends ss.sitetree */{
|
|
||||||
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 = $('#Form_EditForm :input[name=ID]').val();
|
var tree = $('#sitetree')[0], id = $('#Form_EditForm :input[name=ID]').val();
|
||||||
this[0].setCurrentByIdx(id);
|
if(!id) id = 0;
|
||||||
}
|
tree.setCurrentByIdx(id);
|
||||||
};
|
}, 200);
|
||||||
});
|
});
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
|
|
||||||
@ -233,10 +229,8 @@ TreeNodeAPI.prototype = {
|
|||||||
self.removeNodeClass('loading');
|
self.removeNodeClass('loading');
|
||||||
|
|
||||||
var pageID = jQuery(this).find(':input[name=ID]').val();
|
var pageID = jQuery(this).find(':input[name=ID]').val();
|
||||||
if(pageID) {
|
|
||||||
jQuery('#sitetree')[0].setCurrentByIdx(pageID);
|
jQuery('#sitetree')[0].setCurrentByIdx(pageID);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if(xmlhttp) this.addNodeClass('loading');
|
if(xmlhttp) this.addNodeClass('loading');
|
||||||
|
Loading…
Reference in New Issue
Block a user