Fix scrollbars on project_tree
(brought from pillar-web)
This commit is contained in:
parent
9c59b06ab9
commit
25fb4ce842
@ -157,16 +157,16 @@ function containerResizeY(window_height){
|
|||||||
var container_offset = $('#project-container').offset();
|
var container_offset = $('#project-container').offset();
|
||||||
var container_height = window_height - container_offset.top;
|
var container_height = window_height - container_offset.top;
|
||||||
var container_height_wheader = window_height - container_offset.top - $('#project_nav-header').height();
|
var container_height_wheader = window_height - container_offset.top - $('#project_nav-header').height();
|
||||||
var window_height_minus_nav = $('#project_nav').height() - $('#project_nav-header').height();
|
var window_height_minus_nav = window_height - $('#project_nav-header').height();
|
||||||
|
|
||||||
$('#project_context-header').width($('#project_context-container').width());
|
$('#project_context-header').width($('#project_context-container').width());
|
||||||
|
|
||||||
$('#project_nav-container, .project_split').css(
|
if ($(window).width() > 768) {
|
||||||
|
$('#project_nav-container, #project_tree, .project_split').css(
|
||||||
{'max-height': window_height_minus_nav + 'px',
|
{'max-height': window_height_minus_nav + 'px',
|
||||||
'height': window_height_minus_nav + 'px'}
|
'height': window_height_minus_nav + 'px'}
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($(window).width() > 768) {
|
|
||||||
if (container_height > parseInt($('#project-container').css("min-height"))) {
|
if (container_height > parseInt($('#project-container').css("min-height"))) {
|
||||||
if (projectTree){
|
if (projectTree){
|
||||||
$(projectTree).css(
|
$(projectTree).css(
|
||||||
@ -174,7 +174,8 @@ function containerResizeY(window_height){
|
|||||||
'height': container_height_wheader + 'px'}
|
'height': container_height_wheader + 'px'}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (projectTree){ Ps.update(projectTree) }
|
if (projectTree){ Ps.update(projectTree) }
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
| {{ project.name }}
|
| {{ project.name }}
|
||||||
|
|
||||||
// TODO - make list a macro
|
// TODO - make list a macro
|
||||||
#project_tree
|
#project_tree.edit
|
||||||
ul.project_nav-edit-list
|
ul.project_nav-edit-list
|
||||||
li(class="{% if title == 'edit' %}active{% endif %}")
|
li(class="{% if title == 'edit' %}active{% endif %}")
|
||||||
a(href="{{ url_for('projects.edit', project_url=project.url) }}")
|
a(href="{{ url_for('projects.edit', project_url=project.url) }}")
|
||||||
@ -174,11 +174,6 @@ script(type='text/javascript', src="{{ url_for('static_pillar', filename='assets
|
|||||||
|
|
||||||
script(type="text/javascript").
|
script(type="text/javascript").
|
||||||
|
|
||||||
/* UI Stuff */
|
|
||||||
$(window).on("load resize",function(){
|
|
||||||
containerResizeY($(window).height());
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Initialize scrollbars */
|
/* Initialize scrollbars */
|
||||||
if ((typeof Ps !== 'undefined') && window.innerWidth > 768){
|
if ((typeof Ps !== 'undefined') && window.innerWidth > 768){
|
||||||
Ps.initialize(document.getElementById('project_tree'), {suppressScrollX: true});
|
Ps.initialize(document.getElementById('project_tree'), {suppressScrollX: true});
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
| {{ project.name }}
|
| {{ project.name }}
|
||||||
|
|
||||||
// TODO - make list a macro
|
// TODO - make list a macro
|
||||||
#project_tree
|
#project_tree.edit
|
||||||
ul.project_nav-edit-list
|
ul.project_nav-edit-list
|
||||||
li(class="{% if title == 'edit' %}active{% endif %}")
|
li(class="{% if title == 'edit' %}active{% endif %}")
|
||||||
a(href="{{ url_for('projects.edit', project_url=project.url) }}")
|
a(href="{{ url_for('projects.edit', project_url=project.url) }}")
|
||||||
@ -99,10 +99,6 @@
|
|||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
|
|
||||||
| {% block footer_scripts %}
|
| {% block footer_scripts %}
|
||||||
script(type="text/javascript").
|
|
||||||
$(window).on("load resize",function(){
|
|
||||||
containerResizeY($(window).height());
|
|
||||||
});
|
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
| {% block footer_navigation %}
|
| {% block footer_navigation %}
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
| {{ project.name }}
|
| {{ project.name }}
|
||||||
|
|
||||||
// TODO - make list a macro
|
// TODO - make list a macro
|
||||||
#project_tree
|
#project_tree.edit
|
||||||
ul.project_nav-edit-list
|
ul.project_nav-edit-list
|
||||||
li(class="{% if title == 'edit' %}active{% endif %}")
|
li(class="{% if title == 'edit' %}active{% endif %}")
|
||||||
a(href="{{ url_for('projects.edit', project_url=project.url) }}")
|
a(href="{{ url_for('projects.edit', project_url=project.url) }}")
|
||||||
@ -140,10 +140,6 @@
|
|||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
|
|
||||||
| {% block footer_scripts %}
|
| {% block footer_scripts %}
|
||||||
script(type="text/javascript").
|
|
||||||
$(window).on("load resize",function(){
|
|
||||||
containerResizeY($(window).height());
|
|
||||||
});
|
|
||||||
| {% if (project.user == current_user.objectid or current_user.has_role('admin')) %}
|
| {% if (project.user == current_user.objectid or current_user.has_role('admin')) %}
|
||||||
script(src='//cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js')
|
script(src='//cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js')
|
||||||
script.
|
script.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user