forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-38923 theme bootstrapbase: theme clean: enable docking
- Loading branch information
Showing
6 changed files
with
247 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
function customise_dock_for_theme() { | ||
var dock = M.core_dock; | ||
dock.on('dock:itemschanged', theme_dockmod_handle_spans); | ||
dock.on('dock:panelgenerated', theme_dockmod_blockstyle); | ||
} | ||
|
||
//Add the "block" class to docked blocks. This prevents having to restyle | ||
//all docked blocks and simply use standard block styling | ||
function theme_dockmod_blockstyle() { | ||
Y.all('.dockeditempanel_content').each(function(dockblock){ | ||
dockblock.addClass('block'); | ||
}); | ||
} | ||
|
||
//On docking and undocking the bootstrap spans have to change to | ||
//dock properly | ||
function theme_dockmod_handle_spans() { | ||
|
||
var prepopulatedblockregions = 0; | ||
var postpopulatedblockregions = 0; | ||
|
||
var blockspre = 0; | ||
var blockspost = 0; | ||
|
||
var maincontent = Y.one('#region-main'); | ||
var regionpre = Y.one('#block-region-side-pre'); | ||
var regionpost = Y.one('#block-region-side-post'); | ||
var ltr = Y.one('body.dir-ltr'); | ||
var mainwrapper = Y.one('#region-bs-main-and-pre'); | ||
if (!ltr) { | ||
var mainwrapper = Y.one('#region-bs-main-and-post'); | ||
} | ||
|
||
var body = Y.one('body'); | ||
|
||
if (Y.all('.block.dock_on_load').size()>0) { | ||
// Do not resize during initial load | ||
return; | ||
} | ||
|
||
if (body.hasClass('blocks-moving')) { | ||
// open up blocks during blocks positioning | ||
return; | ||
} | ||
|
||
|
||
if (body.hasClass('two-column')) { | ||
|
||
var prehasblocks = (regionpre.all('.block').size() > 0); | ||
if (prehasblocks) { | ||
regionpre.addClass('span3'); | ||
maincontent.removeClass('span12'); | ||
maincontent.addClass('span9'); | ||
} else { | ||
regionpre.removeClass('span3'); | ||
maincontent.removeClass('span9'); | ||
maincontent.addClass('span12'); | ||
} | ||
} else { | ||
|
||
var prehasblocks = (regionpre.all('.block').size() > 0); | ||
if (prehasblocks) { | ||
regionpre.addClass('span4'); | ||
maincontent.removeClass('span12'); | ||
maincontent.addClass('span8'); | ||
} else { | ||
regionpre.removeClass('span4'); | ||
maincontent.removeClass('span8'); | ||
maincontent.addClass('span12'); | ||
} | ||
|
||
var posthasblocks = (regionpost.all('.block').size() > 0); | ||
if (posthasblocks) { | ||
regionpost.addClass('span3'); | ||
mainwrapper.removeClass('span12'); | ||
mainwrapper.addClass('span9'); | ||
} else { | ||
mainwrapper.removeClass('span9'); | ||
mainwrapper.addClass('span12'); | ||
regionpost.removeClass('span3'); | ||
} | ||
} | ||
return; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
.dockbutton { | ||
.btn; | ||
display: list-item; | ||
padding: 0; | ||
} | ||
|
||
body.has_dock { | ||
margin-left: 20px; | ||
div#dock { | ||
display: inline; | ||
} | ||
} | ||
|
||
#dock { | ||
width: 36px; | ||
position: fixed; | ||
top: 68px; | ||
left: 0px; | ||
height: 90%; | ||
background-color: transparent; | ||
border-right: 0 none; | ||
.nothingdocked { | ||
visibility: hidden; | ||
display: none; | ||
} | ||
.dockeditem .firstdockitem { | ||
margin-top: 1em; | ||
} | ||
.dockedtitle { | ||
.dockbutton; | ||
cursor: pointer; | ||
margin: 2px; | ||
h2 { | ||
font-family: @sansFontFamily; | ||
font-size: 1em; | ||
line-height: 100%; | ||
text-align: center; | ||
font-weight: bold; | ||
} | ||
|
||
.filterrotate { | ||
margin-left: 8px; | ||
} | ||
} | ||
.dockeditempanel_hd h2 { | ||
.nav-header; | ||
font-size: 1.1em; | ||
} | ||
.controls { | ||
position: absolute; | ||
bottom: 1em; | ||
text-align: center; | ||
width: 100%; | ||
img { | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
|
||
#dockeditempanel { | ||
min-width: 200px; | ||
position: relative; | ||
z-index: 12000; | ||
left: 100%; | ||
padding-left: 5px; | ||
.dockeditempanel_content { | ||
z-index: 12050; | ||
background-color: @wellBackground; | ||
width: 220px; | ||
box-shadow: 2px 4px 4px 2px #CCCCCC; | ||
} | ||
.dockeditempanel_bd { | ||
overflow: auto; | ||
width: auto; | ||
.block_navigation .block_tree li { | ||
overflow: visible; | ||
} | ||
} | ||
.dockeditempanel_hd { | ||
h2 { | ||
padding: 10px; | ||
margin: 0; | ||
border-bottom: 1px solid @white; | ||
} | ||
.commands { | ||
width: 60px; | ||
float: right; | ||
position: absolute; | ||
right: 0px; | ||
display: block; | ||
text-align: right; | ||
top: 6px; | ||
} | ||
.commands > a, | ||
.commands > span { | ||
margin-left: 3px; | ||
cursor: pointer; | ||
} | ||
a.editing_move, | ||
a.editing_edit, | ||
a.editing_roles, | ||
a.editing_delete, | ||
a.editing_hide { | ||
display: none; | ||
} | ||
.commands img, | ||
.commands input { | ||
vertical-align: middle; | ||
margin-right: 1px; | ||
} | ||
.commands .hidepanemicon img { | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
} | ||
|
||
#dockeditempanel.dockitempanel_hidden { | ||
display: none; | ||
} | ||
|
||
.dir-rtl { | ||
#dockeditempanel { | ||
right: 100%; | ||
.dockeditempanel_hd .commands { | ||
text-align: left; | ||
} | ||
} | ||
#dock { | ||
left: auto; | ||
right: 0%; | ||
.dockedtitle { | ||
border-bottom: 1px solid #DDD; | ||
border-top: 1px solid #EEE; | ||
cursor: pointer; | ||
} | ||
} | ||
.dockeditempanel_hd { | ||
h2 { | ||
padding: 10px; | ||
margin: 0; | ||
border-bottom: 1px solid @white; | ||
} | ||
.commands { | ||
float: left; | ||
right: auto; | ||
left: 0px; | ||
text-align: left; | ||
top: 6px; | ||
} | ||
} | ||
} | ||
|
||
body.dir-rtl.has_dock { | ||
margin-left: 0px; | ||
margin-right: 20px; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters