Skip to content

Commit

Permalink
Presun menu portál, o linuxe
Browse files Browse the repository at this point in the history
  • Loading branch information
mireq committed Jan 20, 2018
1 parent 6c64700 commit 5ea2f1e
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
19 changes: 18 additions & 1 deletion static/alpha/scss/_header.scss
Expand Up @@ -155,6 +155,8 @@
}

#search_panel {
overflow: hidden;

.search-input {
box-shadow: 0px 0px 3px -1px rgba(0, 0, 0, 0.5);
}
Expand All @@ -175,6 +177,12 @@
}
}

#menu_panel {
.module {
display: none;
}
}

@media #{$large-down} {
#header {
.search-link {
Expand Down Expand Up @@ -229,13 +237,20 @@
display: none;
}
}

.module {
display: block;
}
}

.menu, #main_menu {
border-bottom: 1px solid $light-border-color;
}

#main_menu {
position: static;
padding: $base-margin-reduced 0;
margin: 0;
border-bottom: 1px solid $light-border-color;
li {
float: none;
padding: 0;
Expand Down Expand Up @@ -305,6 +320,8 @@

#search_panel {
display: block;
bottom: 0;
margin: $base-margin 0;
.search-input {
box-shadow: none;
border: 1px solid $light-border-color;
Expand Down
4 changes: 4 additions & 0 deletions static/alpha/scss/_layout.scss
Expand Up @@ -216,4 +216,8 @@ $small-header-height: sprite-height(logo_mini) + ($base-margin-reduced * 2);
#main_content {
margin-top: 0px;
}

#module_block_linux, #module_block_portal, #module_block_recommended, #module_block_support {
display: none;
}
}
25 changes: 25 additions & 0 deletions static/js/menu.js
Expand Up @@ -20,8 +20,33 @@ var registerUserPanel = function(root) {
});
};

var copyMenu = function(root) {
if (root !== document.body) {
return;
}

var clone;
var menuPanel = _.id('menu_panel');
var searchPanel = _.id('search_panel');
var blockLinux = _.id('module_block_linux');
var blockPortal = _.id('module_block_portal');
if (menuPanel === null || searchPanel === null || blockLinux === null || blockPortal === null) {
return;
}

clone = blockPortal.cloneNode(true);
clone.setAttribute('id', clone.getAttribute('id') + '_clone');
menuPanel.insertBefore(clone, searchPanel);

clone = blockLinux.cloneNode(true);
clone.setAttribute('id', clone.getAttribute('id') + '_clone');
menuPanel.insertBefore(clone, searchPanel);
console.log(blockLinux.cloneNode(true));
};

_.onLoad(function(e) {
registerUserPanel(e.memo);
copyMenu(e.memo);
});

var onClick = function(e) {
Expand Down
10 changes: 5 additions & 5 deletions templates/template_overrides/alpha/base.html
Expand Up @@ -95,32 +95,32 @@ <h2 class="block-title">Správy</h2>
<div id="sidebar_2">
{% block right %}
<div class="module-group">
<div class="module linux">
<div id="module_block_linux" class="module linux">
<h2 class="block-title">O Linuxe</h2>
<ul class="menu">
{% include "partials/menu_linux.html" %}
</ul>
</div>
<div class="module portal">
<div id="module_block_portal" class="module portal">
<h2 class="block-title">Portál</h2>
<ul class="menu">
{% include "partials/menu_portal.html" %}
</ul>
</div>
<div class="module odporucam">
<div id="module_block_recommended" class="module odporucam">
<h2 class="block-title">Odporúčame</h2>
<div class="module-row">
{% include "static/block-odporucame.html" %}
</div>
</div>
<div class="module podporte">
<div id="module_block_support" class="module podporte">
<h2 class="block-title">Podporte nás</h2>
<div class="module-row">
{% include "static/block-podporte.html" %}
</div>
</div>
</div>
<div class="module polls">
<div id="module_block_polls" class="module polls">
<h2 class="block-title">Anketa</h2>
<div class="module-row">
{{ render_messages(messages, 'polls') }}
Expand Down

0 comments on commit 5ea2f1e

Please sign in to comment.