Themes: fix overlays and buttons in responsive mode, props matveb, fixes #26481.

Built from https://develop.svn.wordpress.org/trunk@26838


git-svn-id: http://core.svn.wordpress.org/trunk@26725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2013-12-09 19:38:10 +00:00
parent 39b1bc785d
commit 4f44dc74b1
6 changed files with 39 additions and 4 deletions

View File

@ -7194,15 +7194,26 @@ body.folded .theme-overlay .theme-wrap {
.theme-browser .theme .theme-actions {
padding: 5px 10px 4px 10px;
}
.theme-overlay.small-screenshot .theme-screenshots {
position: static;
float: none;
max-width: 302px;
}
.theme-overlay.small-screenshot .theme-info {
margin-right: 0;
width: auto;
}
.theme:not(.active):hover .theme-actions,
.theme:hover .more-details {
display: none;
}
.theme-browser.rendered .theme:hover .theme-screenshot img {
opacity: 1.0;
}
}
@media only screen and (max-width: 480px) {

File diff suppressed because one or more lines are too long

View File

@ -7194,15 +7194,26 @@ body.folded .theme-overlay .theme-wrap {
.theme-browser .theme .theme-actions {
padding: 5px 10px 4px 10px;
}
.theme-overlay.small-screenshot .theme-screenshots {
position: static;
float: none;
max-width: 302px;
}
.theme-overlay.small-screenshot .theme-info {
margin-left: 0;
width: auto;
}
.theme:not(.active):hover .theme-actions,
.theme:hover .more-details {
display: none;
}
.theme-browser.rendered .theme:hover .theme-screenshot img {
opacity: 1.0;
}
}
@media only screen and (max-width: 480px) {

File diff suppressed because one or more lines are too long

View File

@ -187,9 +187,13 @@ themes.view.Theme = wp.Backbone.View.extend({
html: themes.template( 'theme' ),
events: {
'click': 'expand'
'click': 'expand',
'touchend': 'expand',
'touchmove': 'preventExpand'
},
touchDrag: false,
render: function() {
var data = this.model.toJSON();
// Render themes using the html template
@ -215,6 +219,11 @@ themes.view.Theme = wp.Backbone.View.extend({
expand: function( event ) {
var self = this;
// Bail if the user scrolled on a touch device
if ( this.touchDrag === true ) {
return this.touchDrag = false;
}
event = event || window.event;
// Prevent the modal from showing when the user clicks
@ -224,6 +233,10 @@ themes.view.Theme = wp.Backbone.View.extend({
}
this.trigger( 'theme:expand', self.model.cid );
},
preventExpand: function() {
this.touchDrag = true;
}
});

File diff suppressed because one or more lines are too long