load_dashboard()
load_authorized_widget_definitions()
elsif @snapshot
- # display the layout of the parent, usually the directory, but display the file viewers
+ # display the layout of the parent without the sidebar, usually the directory, but display the file viewers
+ @hide_sidebar = true
@file = @resource
@project = @snapshot.parent.project
render :action => 'no_dashboard'
<%= render :partial => 'gwt/base', :locals => {:resource => nil, :popup => false, :metric => nil} -%>
<%= render :partial => 'gwt/resource_viewers' -%>
-<img id="page_loading" src="<%= ApplicationController.root_context -%>/images/loading.gif">
-<div id="resource_container"></div>
+<div id="accordion-panel"></div>
<script type="text/javascript">
+
// see if an anchor has been passed
var anchor;
var stripped_url = document.location.toString().split("#");
anchor = stripped_url[1];
}
- // and call the resource page
- new Ajax.Updater('resource_container', '<%= url_for params.merge({:controller => 'resource', :action => :index, :id => @file.id}) -%>',
- {
- asynchronous:true,
- evalScripts:true,
- onComplete:function (transport) {
- $('page_loading').hide();
+ openAccordionItem('<%= url_for(params.merge({:controller => 'resource', :action => :index, :id => @file.id, :display_title => 'false', :popup => 'false'})) -%>', this, false)
+ .done(function () {
if (anchor != null) {
window.location.hash = anchor;
}
- }
- });
+ });
+
</script>
<% elsif displayed_resource %>
+ <% puts "### dis "+ displayed_resource.to_s %>
+
<div id="crumbs">
<ul id="crumbs-ops">
<% if displayed_resource && !@review %>
</div>
<%= render 'layouts/breadcrumb' if @breadcrumbs || selected_section==Navigation::SECTION_RESOURCE -%>
<div id="body">
- <% if selected_section %>
+ <% if selected_section && (!@hide_sidebar) %>
<div id="sidebar">
<ul class="sidebar blue-sidebar">
<% if selected_section==Navigation::SECTION_HOME %>
</ul>
</div>
<% end %>
- <div <%= "id='content' class='with_sidebar'" if selected_section -%>>
+ <%
+ html_id_class = ''
+ html_id_class = "id='content' class='with_sidebar'" if selected_section
+ html_id_class = "id='content'" if @hide_sidebar
+ %>
+ <div <%= html_id_class -%>>
<% if @project %>
<div class="print"><h2><%= h @project.name(true) %></h2></div>
<% end %>
}
// Get content from url
- $j.get(url,function (html) {
+ var ajaxRequest = $j.get(url,function (html) {
if (currentElement.length) {
var body = currentElement.find('.accordion-item-body');
if (!updateCurrentElement && !body.hasClass('accordion-item-body-medium')) {
loading.remove();
});
- return false;
+ return ajaxRequest;
}
function expandAccordionItem(elt) {