Skip to content

Commit

Permalink
Media at small screens:
Browse files Browse the repository at this point in the history
- Show the image details/settings as an overlay.
- Better styling for the frame drop-down.
- Remove the multi-select by default on the Insert frame.
See #27423
Built from https://develop.svn.wordpress.org/trunk@29452


git-svn-id: http://core.svn.wordpress.org/trunk@29230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
azaozz committed Aug 9, 2014
1 parent 5cab03a commit d11bb9b
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 60 deletions.
51 changes: 30 additions & 21 deletions wp-includes/css/media-views-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -2151,27 +2151,35 @@
}

.media-menu {
display: none;
width: auto;
max-width: 80%;
overflow: auto;
z-index: 2000;
top: 50px;
right: -300px;
left: auto;
bottom: auto;
padding: 5px 0;
border: 1px solid #ccc;
}

.media-menu.visible {
z-index: 2000;
display: block;
position: fixed;
top: 30px;
right: 30px;
left: 30px;
bottom: 30px;
width: 250px;
max-width: 100%;
overflow: auto;
right: 0;
}

.media-menu > a {
padding: 10px 20px;
padding: 12px 16px;
font-size: 16px;
}

.media-menu > a.active {
display: none;
}

.media-menu .separator {
margin: 5px 10px;
}

.media-frame-title {
right: 0;
color: #21759b;
Expand Down Expand Up @@ -2296,10 +2304,6 @@
display: none;
}

.media-menu .separator {
margin: 12px 10px;
}

.media-modal .attachments-browser .media-toolbar-primary,
.media-modal .attachments-browser .media-toolbar-secondary {
width: 50%;
Expand Down Expand Up @@ -2339,8 +2343,7 @@
@media only screen and (max-width: 640px), screen and (max-height: 400px) {
/* Full-bleed modal */
.media-modal,
.image-details .media-modal,
.media-menu.visible {
.image-details .media-modal {
position: fixed;
top: 0;
right: 0;
Expand All @@ -2353,7 +2356,15 @@
}

.media-sidebar {
display: none;
z-index: 1900;
max-width: 70%;
bottom: 120%;
box-sizing: border-box;
padding-bottom: 0;
}

.media-sidebar.visible {
bottom: 0;
}

.attachments-browser .attachments,
Expand All @@ -2362,8 +2373,6 @@
left: 0;
}



.image-details .media-frame-title {
display: block;
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/media-views-rtl.min.css

Large diffs are not rendered by default.

51 changes: 30 additions & 21 deletions wp-includes/css/media-views.css
Original file line number Diff line number Diff line change
Expand Up @@ -2151,27 +2151,35 @@
}

.media-menu {
display: none;
width: auto;
max-width: 80%;
overflow: auto;
z-index: 2000;
top: 50px;
left: -300px;
right: auto;
bottom: auto;
padding: 5px 0;
border: 1px solid #ccc;
}

.media-menu.visible {
z-index: 2000;
display: block;
position: fixed;
top: 30px;
left: 30px;
right: 30px;
bottom: 30px;
width: 250px;
max-width: 100%;
overflow: auto;
left: 0;
}

.media-menu > a {
padding: 10px 20px;
padding: 12px 16px;
font-size: 16px;
}

.media-menu > a.active {
display: none;
}

.media-menu .separator {
margin: 5px 10px;
}

.media-frame-title {
left: 0;
color: #21759b;
Expand Down Expand Up @@ -2296,10 +2304,6 @@
display: none;
}

.media-menu .separator {
margin: 12px 10px;
}

.media-modal .attachments-browser .media-toolbar-primary,
.media-modal .attachments-browser .media-toolbar-secondary {
width: 50%;
Expand Down Expand Up @@ -2339,8 +2343,7 @@
@media only screen and (max-width: 640px), screen and (max-height: 400px) {
/* Full-bleed modal */
.media-modal,
.image-details .media-modal,
.media-menu.visible {
.image-details .media-modal {
position: fixed;
top: 0;
left: 0;
Expand All @@ -2353,7 +2356,15 @@
}

.media-sidebar {
display: none;
z-index: 1900;
max-width: 70%;
bottom: 120%;
box-sizing: border-box;
padding-bottom: 0;
}

.media-sidebar.visible {
bottom: 0;
}

.attachments-browser .attachments,
Expand All @@ -2362,8 +2373,6 @@
right: 0;
}



.image-details .media-frame-title {
display: block;
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/media-views.min.css

Large diffs are not rendered by default.

22 changes: 9 additions & 13 deletions wp-includes/js/media-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -4648,7 +4648,6 @@
tagName: 'li',
className: 'attachment',
template: media.template('attachment'),
_isTouch: false,

attributes: {
tabIndex: 0,
Expand All @@ -4657,7 +4656,6 @@

events: {
'click .js--select-attachment': 'toggleSelectionHandler',
'touchend .attachment-preview': 'setTouch',
'change [data-setting]': 'updateSetting',
'change [data-setting] input': 'updateSetting',
'change [data-setting] select': 'updateSetting',
Expand Down Expand Up @@ -4783,10 +4781,6 @@
}
},

setTouch: function() {
this._isTouch = true;
},

/**
* @param {Object} event
*/
Expand Down Expand Up @@ -4825,11 +4819,6 @@
method = 'toggle';
}

if ( this._isTouch ) {
this._isTouch = false;
method = 'add';
}

this.toggleSelection({
method: method
});
Expand Down Expand Up @@ -4948,9 +4937,10 @@
}

// Fixes bug that loses focus when selecting a featured image
if ( !method ) {
if ( ! method ) {
method = 'add';
}

if ( method !== 'add' ) {
method = 'reset';
}
Expand Down Expand Up @@ -5980,13 +5970,20 @@
userSettings: this.model.get('displayUserSettings')
}) );
}

// Show the sidebar on mobile
if ( this.model.id === 'insert' ) {
sidebar.$el.addClass( 'visible' );
}
},

disposeSingle: function() {
var sidebar = this.sidebar;
sidebar.unset('details');
sidebar.unset('compat');
sidebar.unset('display');
// Hide the sidebar on mobile
sidebar.$el.removeClass( 'visible' );
}
});

Expand Down Expand Up @@ -6914,7 +6911,6 @@
value = Math.round( this.model.get( 'aspectRatio' ) * num );
this.model.set( 'customWidth', value, { silent: true } );
this.$( '[data-setting="customWidth"]' ).val( value );

}
},

Expand Down
4 changes: 2 additions & 2 deletions wp-includes/js/media-views.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.0-beta3-20140808';
$wp_version = '4.0-beta3-20140809';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit d11bb9b

Please sign in to comment.