Commit dc29f5ba authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Edit page - fix drag into narrow col, and block title layout"

parents 0d479b7d 1e0488c7
......@@ -334,9 +334,23 @@
$('.column .column-content').sortable({
handle: '.js-heading',
items: '.js-blockinstance',
cursorAt: {left: 5, top: 0},
cursorAt: {left: 100, top: 10},
connectWith: '.js-col-row .column .column-content',
placeholder: 'block-placeholder',
tolerance: "pointer",
activate: function(event, ui) {
// Fix for dragging blocks to narrow divs:
// Wide elements must be centred on narrow divs to make droppable.
// This is not always evident to the user.
// Instead set a standard small width when starting to sort.
// Dynamically setting width on over event doesn't work, as
// Sortable seems to cache helper proportions.
// Also if height of dragging block is greater than height
// row(s) above it then it can't be dropped in that row.
// Could use a custom version of Sortable in future?
ui.helper.width(200);
ui.helper.height('auto');
},
beforeStop: function(event, ui) {
var whereTo = getBlockinstanceCoordinates(ui.helper);
......
......@@ -105,6 +105,14 @@
}
}
// Specific panel-secondary styling for the edit page layout
.panel-secondary.blockinstance > .panel-heading > .blockinstance-header {
display: block;
padding-left: 10px;
padding-right: 80px;
word-break: normal;
}
// Custom styles for edit collection pages
// See views.tpl and views.json.tpl
.manage-collection-pages {
......
......@@ -11,6 +11,7 @@
opacity: 1;
}
.panel-secondary & {
float: left;
margin-top: -5px;
margin-left: -6px;
margin-right: -2px;
......
......@@ -71,6 +71,15 @@
width: 100% !important;
}
// Edit page sortable - hide everything but title
.ui-sortable-helper .blockinstance-content,
.ui-sortable-helper .blockinstance-controls {
display: none;
}
.ui-sortable-helper.panel-secondary.blockinstance > .panel-heading > .blockinstance-header {
padding-right: 0;
}
// Droppable area background indicator
.block-drop-on {
background: darken($panel-default-heading-bg, 5%) ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment