Fix TinyMCE Views in IE8 and 7:
- Add fallback background images for dashicons. - Fix hiding the clipboard while still allowing the contents to be selected. - Work around lack of border-box in gallery styles. (Includes precommit cleanup for theme.js) Props gcorne, fixes 27546 Built from https://develop.svn.wordpress.org/trunk@28062 git-svn-id: http://core.svn.wordpress.org/trunk@27894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5ca1024284
commit
cc694bac21
|
@ -551,7 +551,7 @@ themes.view.Theme = wp.Backbone.View.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
this.listenTo( preview, 'preview:close', function() {
|
this.listenTo( preview, 'preview:close', function() {
|
||||||
self.current = self.model
|
self.current = self.model;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -755,8 +755,8 @@ themes.view.Preview = themes.view.Details.extend({
|
||||||
html: themes.template( 'theme-preview' ),
|
html: themes.template( 'theme-preview' ),
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
var data = this.model.toJSON(),
|
var data = this.model.toJSON();
|
||||||
self = this;
|
|
||||||
this.$el.html( this.html( data ) );
|
this.$el.html( this.html( data ) );
|
||||||
|
|
||||||
themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.get( 'id' ) ), { replace: true } );
|
themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.get( 'id' ) ), { replace: true } );
|
||||||
|
|
|
@ -265,12 +265,20 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.dom.bind( editor.getBody(), 'mousedown mouseup click', function( event ) {
|
editor.dom.bind( editor.getBody(), 'mousedown mouseup click', function( event ) {
|
||||||
var view = getParentView( event.target );
|
var view = getParentView( event.target ),
|
||||||
|
deselectEventType;
|
||||||
|
|
||||||
// Contain clicks inside the view wrapper
|
// Contain clicks inside the view wrapper
|
||||||
if ( view ) {
|
if ( view ) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
|
// Hack to try and keep the block resize handles from appearing. They will show on mousedown and then be removed on mouseup.
|
||||||
|
if ( tinymce.Env.ie <= 10 ) {
|
||||||
|
deselect();
|
||||||
|
}
|
||||||
|
|
||||||
|
select( view );
|
||||||
|
|
||||||
if ( event.type === 'click' && ! event.metaKey && ! event.ctrlKey ) {
|
if ( event.type === 'click' && ! event.metaKey && ! event.ctrlKey ) {
|
||||||
if ( editor.dom.hasClass( event.target, 'edit' ) ) {
|
if ( editor.dom.hasClass( event.target, 'edit' ) ) {
|
||||||
wp.mce.views.edit( view );
|
wp.mce.views.edit( view );
|
||||||
|
@ -278,12 +286,20 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||||
editor.dom.remove( view );
|
editor.dom.remove( view );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
select( view );
|
|
||||||
// Returning false stops the ugly bars from appearing in IE11 and stops the view being selected as a range in FF.
|
// Returning false stops the ugly bars from appearing in IE11 and stops the view being selected as a range in FF.
|
||||||
// Unfortunately, it also inhibits the dragging of views to a new location.
|
// Unfortunately, it also inhibits the dragging of views to a new location.
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if ( event.type === 'mousedown' ) {
|
|
||||||
|
// Fix issue with deselecting a view in IE8. Without this hack, clicking content above the view wouldn't actually deselect it
|
||||||
|
// and the caret wouldn't be placed at the mouse location
|
||||||
|
if( tinymce.Env.ie <= 8 ) {
|
||||||
|
deselectEventType = 'mouseup';
|
||||||
|
} else {
|
||||||
|
deselectEventType = 'mousedown';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( event.type === deselectEventType ) {
|
||||||
deselect();
|
deselect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 251 B |
Binary file not shown.
After Width: | Height: | Size: 164 B |
|
@ -198,10 +198,14 @@ audio {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
clip: rect(1px 1px 1px 1px); /* IE7 */
|
||||||
clip: rect(1px, 1px, 1px, 1px);
|
clip: rect(1px, 1px, 1px, 1px);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
width: 100%;
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,12 +218,16 @@ audio {
|
||||||
}
|
}
|
||||||
|
|
||||||
.wpview-wrap.selected {
|
.wpview-wrap.selected {
|
||||||
background-color: #f2f8ff; /* fallback to old blue */
|
|
||||||
background-color: rgba(0,0,0,0.1);
|
background-color: rgba(0,0,0,0.1);
|
||||||
border-color: #777;
|
|
||||||
border-color: rgba(0,0,0,0.3);
|
border-color: rgba(0,0,0,0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ie8 .wpview-wrap.selected,
|
||||||
|
.ie7 .wpview-wrap.selected {
|
||||||
|
background-color: #e5e5e5;
|
||||||
|
border-color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
.wpview-overlay {
|
.wpview-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -263,6 +271,25 @@ audio {
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ie8 .wpview-wrap .toolbar div,
|
||||||
|
.ie7 .wpview-wrap .toolbar div,
|
||||||
|
.ie8 #wp-image-toolbar div,
|
||||||
|
.ie7 #wp-image-toolbar div {
|
||||||
|
display: inline;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ie8 .dashicons-edit,
|
||||||
|
.ie7 .dashicons-edit {
|
||||||
|
background-image: url(images/dashicon-edit.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ie8 .dashicons-no-alt,
|
||||||
|
.ie7 .dashicons-no-alt {
|
||||||
|
background-image: url(images/dashicon-no-alt.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.wpview-wrap .toolbar div:hover,
|
.wpview-wrap .toolbar div:hover,
|
||||||
#wp-image-toolbar div:hover {
|
#wp-image-toolbar div:hover {
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.8);
|
box-shadow: 0 1px 3px rgba(0,0,0,0.8);
|
||||||
|
@ -318,6 +345,11 @@ audio {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ie7 .gallery,
|
||||||
|
.ie8 .gallery {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.gallery-error {
|
.gallery-error {
|
||||||
border: 1px solid #dedede;
|
border: 1px solid #dedede;
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
|
@ -352,6 +384,11 @@ audio {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ie7 .gallery .gallery-item,
|
||||||
|
.ie8 .gallery .gallery-item {
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
|
||||||
.gallery .gallery-caption,
|
.gallery .gallery-caption,
|
||||||
.gallery .gallery-icon {
|
.gallery .gallery-icon {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -374,6 +411,11 @@ audio {
|
||||||
width: 33.333%;
|
width: 33.333%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ie8 .gallery-columns-3 .gallery-item,
|
||||||
|
.ie7 .gallery-columns-3 .gallery-item {
|
||||||
|
width: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
.gallery-columns-4 .gallery-item {
|
.gallery-columns-4 .gallery-item {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
}
|
}
|
||||||
|
@ -383,7 +425,7 @@ audio {
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery-columns-6 .gallery-item {
|
.gallery-columns-6 .gallery-item {
|
||||||
width: 16.667%;
|
width: 16.665%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery-columns-7 .gallery-item {
|
.gallery-columns-7 .gallery-item {
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue