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:
Andrew Ozz 2014-04-09 00:58:15 +00:00
parent 5ca1024284
commit cc694bac21
7 changed files with 69 additions and 11 deletions

View File

@ -551,7 +551,7 @@ themes.view.Theme = wp.Backbone.View.extend({
});
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' ),
render: function() {
var data = this.model.toJSON(),
self = this;
var data = this.model.toJSON();
this.$el.html( this.html( data ) );
themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.get( 'id' ) ), { replace: true } );

View File

@ -265,12 +265,20 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
});
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
if ( view ) {
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 ( editor.dom.hasClass( event.target, 'edit' ) ) {
wp.mce.views.edit( view );
@ -278,12 +286,20 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
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.
// Unfortunately, it also inhibits the dragging of views to a new location.
return false;
} 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();
}
}

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

View File

@ -198,10 +198,14 @@ audio {
top: 0;
left: 0;
z-index: -1;
clip: rect(1px 1px 1px 1px); /* IE7 */
clip: rect(1px, 1px, 1px, 1px);
overflow: hidden;
outline: 0;
width: 100%;
padding: 0;
border: 0;
width: 1px;
height: 1px;
}
/**
@ -214,12 +218,16 @@ audio {
}
.wpview-wrap.selected {
background-color: #f2f8ff; /* fallback to old blue */
background-color: rgba(0,0,0,0.1);
border-color: #777;
border-color: rgba(0,0,0,0.3);
}
.ie8 .wpview-wrap.selected,
.ie7 .wpview-wrap.selected {
background-color: #e5e5e5;
border-color: #777;
}
.wpview-overlay {
position: absolute;
top: 0;
@ -263,6 +271,25 @@ audio {
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,
#wp-image-toolbar div:hover {
box-shadow: 0 1px 3px rgba(0,0,0,0.8);
@ -318,6 +345,11 @@ audio {
overflow-x: hidden;
}
.ie7 .gallery,
.ie8 .gallery {
margin: auto;
}
.gallery-error {
border: 1px solid #dedede;
padding: 20px 0;
@ -352,6 +384,11 @@ audio {
box-sizing: border-box;
}
.ie7 .gallery .gallery-item,
.ie8 .gallery .gallery-item {
padding: 6px 0;
}
.gallery .gallery-caption,
.gallery .gallery-icon {
margin: 0;
@ -374,6 +411,11 @@ audio {
width: 33.333%;
}
.ie8 .gallery-columns-3 .gallery-item,
.ie7 .gallery-columns-3 .gallery-item {
width: 33%;
}
.gallery-columns-4 .gallery-item {
width: 25%;
}
@ -383,7 +425,7 @@ audio {
}
.gallery-columns-6 .gallery-item {
width: 16.667%;
width: 16.665%;
}
.gallery-columns-7 .gallery-item {