silverstripe-cms/javascript/CMSMain.js
Ingo Schommer c5eadd81ab ENHANCEMENT Using jQuery UI tabs for tree tools like 'search' or 'batch actions' instead of custom JavaScript
API CHANGE Removed 'treeactions' javascript global

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92603 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-21 02:36:09 +00:00

85 lines
2.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function($) {
$('body.CMSMain').concrete({ss:{cmsMain:{
mainLayout: null,
onmatch: function() {
var $this = $(this);
this.mainLayout = this.ss().cmsMain()._setupLayout();
// artificially delay the resize event 200ms
// to avoid overlapping height changes in different onresize() methods
$(window).resize(function () {
var timerID = "timerCMSMainResize";
if (window[timerID]) clearTimeout(window[timerID]);
window[timerID] = setTimeout(function() {$this.ss().cmsMain()._resizeChildren();}, 200);
});
this.ss().cmsMain()._resizeChildren();
},
_resizeChildren: function() {
$("#treepanes").accordion("resize");
$('#sitetree_and_tools').fitHeightToParent();
},
/**
* Initialize jQuery layout manager with the following panes:
* - east: Tree, Page Version History, Site Reports
* - center: Form
* - west: "Insert Image", "Insert Link", "Insert Flash" panes
* - north: CMS area menu bar
* - south: "Page view", "profile" and "logout" links
*/
_setupLayout: function() {
var $this = this;
// layout containing the tree, CMS menu, the main form etc.
var layout = $('body').layout({
defaults: {
// TODO Reactivate once we have localized values
togglerTip_open: '',
togglerTip_closed: '',
resizerTip: '',
sliderTip: ''
},
north: {
slidable: false,
resizable: false,
size: 35,
togglerLength_open: 0
},
south: {
slidable: false,
resizable: false,
size: 20,
togglerLength_open: 0
},
east: {
initClosed: true,
fxName: "none"
},
west: {
size: 250,
onresize: function() {$this.ss().cmsMain()._resizeChildren();},
onopen: function() {$this.ss().cmsMain()._resizeChildren();},
fxName: "none"
},
center: {}
});
// Adjust tree accordion etc. in left panel to work correctly
// with jQuery.layout (see http://layout.jquery-dev.net/tips.html#Widget_Accordion)
this.find("#treepanes").accordion({
fillSpace: true,
animated: false
});
return layout;
}
}}});
})(jQuery);
jQuery(document).ready(function() {
// @todo remove
jQuery.concrete.triggerMatching();
});