diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 1598420073..79fe3c8d86 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -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 } ); diff --git a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js index 75f704788a..337b3d2b2e 100644 --- a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -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(); } } diff --git a/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png b/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png new file mode 100644 index 0000000000..9b2c54de42 Binary files /dev/null and b/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png differ diff --git a/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png b/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png new file mode 100644 index 0000000000..cc0f927350 Binary files /dev/null and b/src/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png differ diff --git a/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css b/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css index fe84a39da3..b6356ad9dd 100644 --- a/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css +++ b/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css @@ -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 {