Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:omeka/omeka-s into file-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kimisgold committed Feb 17, 2016
2 parents e0136ba + d154a4e commit 92bbde6
Show file tree
Hide file tree
Showing 20 changed files with 1,082 additions and 688 deletions.
260 changes: 176 additions & 84 deletions application/asset/css/style.css

Large diffs are not rendered by default.

30 changes: 18 additions & 12 deletions application/asset/js/global.js
@@ -1,9 +1,12 @@
var Omeka = {
openSidebar : function(context,target) {
//close delete sidebar if open
if ($('#delete').hasClass('active')) {
$('#delete').removeClass('active');
if (!context.hasClass('delete')) {
if ($('#delete').hasClass('active')) {
$('#delete').removeClass('mobile active');
}
}

//if already inside top sidebar, open the inner sidebar
if (context.parents('.sidebar').length == 0) {
var sidebar = $('#content > .sidebar');
Expand All @@ -13,7 +16,6 @@ var Omeka = {
if (typeof target !== 'undefined') {
var sidebar = $(target + '.sidebar');
}
sidebar.addClass('active');
if (!$('body').hasClass('sidebar-open')) {
$('body').addClass('sidebar-open');
}
Expand All @@ -28,14 +30,18 @@ var Omeka = {
if (context.attr('data-sidebar-content-url')) {
this.populateSidebarContent(context, sidebar);
}
sidebar.addClass('mobile active');
return sidebar;
},

closeSidebar : function(context) {
context.removeClass('active');
context.closest('.active').removeClass('active');
if ($('.active.sidebar').length < 1) {
$('body').removeClass('sidebar-open');
if (context.hasClass('mobile-only')) {
context.closest('.active').removeClass('mobile');
} else {
context.closest('.active').removeClass('mobile active');
if ($('.active.sidebar').length < 1) {
$('body').removeClass('sidebar-open');
}
}
},

Expand Down Expand Up @@ -126,11 +132,7 @@ var Omeka = {
// Attach sidebar triggers
$('#content').on('click', 'a.sidebar-confirm', function(e) {
e.preventDefault();
if ($('#delete').length > 0) {
Omeka.openSidebar($(this), '#delete');
} else {
Omeka.openSidebar($(this));
}
Omeka.openSidebar($(this), '#delete');
});

// Make resource public or private
Expand Down Expand Up @@ -204,6 +206,10 @@ var Omeka = {
Omeka.switchActiveSection($($(this).attr('href')));
});

$('.section > legend').click(function() {
$(this).parent().toggleClass('mobile-active');
});

// Automatically switch to sections containing invalid elements on submit
// (Use a capturing event listener because 'invalid' doesn't bubble)
document.body.addEventListener('invalid', function (e) {
Expand Down
14 changes: 14 additions & 0 deletions application/asset/js/resource-form.js
@@ -1,6 +1,19 @@
(function($) {

$(document).ready( function() {
// Open sidebars on mobile
$('button.mobile-only').on('click', function(e) {
e.preventDefault();
var mobileButton = $(this);
var sidebarId = mobileButton.attr('id');
sidebarId = sidebarId.replace('-button', '');
$('#' + sidebarId).addClass('mobile');
mobileButton.parents('form').bind('DOMSubtreeModified', function() {
$('.sidebar.active.mobile').removeClass('mobile');
$(this).unbind('DOMSubtreeModified');
});
});

// Select property
$('#property-selector li.selector-child').on('click', function(e) {
e.stopPropagation();
Expand All @@ -10,6 +23,7 @@
if (!field.length) {
field = makeNewField(property);
}
$('#property-selector').removeClass('mobile');
Omeka.scrollTo(field);
});

Expand Down
1 change: 1 addition & 0 deletions application/asset/js/resource-selector.js
Expand Up @@ -31,6 +31,7 @@
e.preventDefault();
var context = $(this);
Omeka.closeSidebar(context);
context.parents('.mobile').removeClass('mobile');
context.trigger('o:resource-selected');
});

Expand Down
100 changes: 73 additions & 27 deletions application/asset/sass/_screen.scss
Expand Up @@ -319,6 +319,10 @@ body {

/* @group ----- Reusable classes ----- */

.mobile-only {
display: none;
}

div[role="main"] > .messages {
@include trailer(.5);

Expand Down Expand Up @@ -1151,8 +1155,7 @@ td .o-icon-private {
padding-top: rhythm(4);
}

.add legend,
.edit legend {
fieldset.section > legend {
position: absolute;
left: -9999px;
}
Expand Down Expand Up @@ -1887,6 +1890,7 @@ input[type="text"].value-language,
.media.row {
padding: rhythm(.5) rhythm(.25) rhythm(.5) rhythm(1.75);
@include trailer(.25);
min-height: rhythm(2);
}

.media.row img {
Expand All @@ -1895,22 +1899,41 @@ input[type="text"].value-language,
top: rhythm(.25);
}

.media.row img + .resource-name {
margin-left: rhythm(2);
}

.media.row .sortable-handle:before {
top: rhythm(.5);
top: rhythm(.375);
}

.media.row .actions {
position: absolute;
right: rhythm(.25);
top: rhythm(.375);
}

.media.row .resource-name {
display: inline-block;
vertical-align: middle;
max-width: calc(100% - #{rhythm(6.5)});
margin-left: rhythm(2);
word-wrap: break-word;
width: calc(100% - #{rhythm(6)});
word-break: break-all;
display: block;
}

.media.value.delete span.restore-value {
padding: 0;
}

.media.value.delete > *:not(.restore-value),
.media.value.delete .actions a:not(.o-icon-undo){
display: none;
}

.media.value.delete > .actions {
display: block;
margin-right: rhythm(-.25);
top: rhythm(.75);
}

.media-header h4 {
font-size: $base-font-size;
margin: rhythm(-.5) rhythm(-.25) rhythm(.25);
Expand Down Expand Up @@ -2458,33 +2481,46 @@ body.sidebar-open #content {
}

.resource-template .property.row {
padding: rhythm(1.75) rhythm(.25) rhythm(.25) rhythm(2);

&.delete {
background-color: $delete-bg;
}

label:first-child,
input[type="text"],
textarea {
textarea,
select {
display: inline-block;
vertical-align: top;
resize: vertical;
}
}

.resource-template .property.row .sortable-handle {
background-color: $gray-on-white;
width: 100%;
top: 0;
left: 0;
height: rhythm(1.5);
position: absolute;

label:first-child {
padding: rhythm(.25) 0 rhythm(.25) rhythm(1.5);
&:before {
top: rhythm(.25);
}
}

.resource-template .property.row label:first-child {
width: span(2 of 10);
margin-right: span(1 of 10);
.resource-template .property.row label,
.resource-template .property.row input[type="text"] {
width: 100%;
height: rhythm(1.5);
line-height: 1.5 * $base-line-height;
}

.resource-template .property.row .actions {
position: absolute;
right: span(7 of 10);
top: rhythm(.5);
right: rhythm(.25);
top: rhythm(.25);
padding: 0 rhythm(.25);
}

Expand All @@ -2495,30 +2531,40 @@ body.sidebar-open #content {

& > li:first-child {
@include field-row;
padding-left: rhythm(1.8333);
}
}

.resource-template .property-heading {
font-weight: bold;
display: inline-block;
width: span(3.5 of 10);
width: span(3 of 9);
}

.resource-template .property-heading:first-of-type {
padding-left: rhythm(1.5);
width: span(3 of 10);
.resource-template .property-heading:not(:first-child) {
margin-left: -4px;
}

.resource-template .property-heading:not(:first-child),
.resource-template .property.row input[type="text"],
.resource-template .property.row textarea {
.resource-template .property.row .property-label,
.resource-template .property.row textarea,
.resource-template .property.row select {
display: inline-block;
width: calc(#{span(3 of 9)} - #{rhythm(.25)});
margin-left: -4px;
margin-right: rhythm(.25);
}

.resource-template .property.row .property-label {
margin-top: rhythm(-1.75);
}

.resource-template .property.row input[type="text"],
.resource-template .property.row textarea {
width: span(3.375 of 10);
margin-right: span(.125 of 10);
.resource-template .property.row label {
margin-bottom: rhythm(.25);
}

.resource-template .property.row select {
width: span(3 of 9);
margin-right: 0;
}

/* @end */
Expand Down

0 comments on commit 92bbde6

Please sign in to comment.