Make WordPress Core

Changeset 28062


Ignore:
Timestamp:
04/09/2014 12:57:46 AM (11 years ago)
Author:
azaozz
Message:

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

Location:
trunk/src
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/theme.js

    r28049 r28062  
    552552
    553553        this.listenTo( preview, 'preview:close', function() {
    554             self.current = self.model
     554            self.current = self.model;
    555555        });
    556556    },
     
    756756
    757757    render: function() {
    758         var data = this.model.toJSON(),
    759             self = this;
     758        var data = this.model.toJSON();
     759
    760760        this.$el.html( this.html( data ) );
    761761
  • trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js

    r27632 r28062  
    266266
    267267        editor.dom.bind( editor.getBody(), 'mousedown mouseup click', function( event ) {
    268             var view = getParentView( event.target );
     268            var view = getParentView( event.target ),
     269                deselectEventType;
    269270
    270271            // Contain clicks inside the view wrapper
    271272            if ( view ) {
    272273                event.stopPropagation();
     274
     275                // Hack to try and keep the block resize handles from appearing. They will show on mousedown and then be removed on mouseup.
     276                if ( tinymce.Env.ie <= 10 ) {
     277                    deselect();
     278                }
     279
     280                select( view );
    273281
    274282                if ( event.type === 'click' && ! event.metaKey && ! event.ctrlKey ) {
     
    279287                    }
    280288                }
    281                 select( view );
    282289                // Returning false stops the ugly bars from appearing in IE11 and stops the view being selected as a range in FF.
    283290                // Unfortunately, it also inhibits the dragging of views to a new location.
    284291                return false;
    285292            } else {
    286                 if ( event.type === 'mousedown' ) {
     293
     294                // Fix issue with deselecting a view in IE8. Without this hack, clicking content above the view wouldn't actually deselect it
     295                // and the caret wouldn't be placed at the mouse location
     296                if( tinymce.Env.ie <= 8 ) {
     297                    deselectEventType = 'mouseup';
     298                } else {
     299                    deselectEventType = 'mousedown';
     300                }
     301
     302                if ( event.type === deselectEventType ) {
    287303                    deselect();
    288304                }
  • trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css

    r27979 r28062  
    199199    left: 0;
    200200    z-index: -1;
     201    clip: rect(1px 1px 1px 1px); /* IE7 */
    201202    clip: rect(1px, 1px, 1px, 1px);
    202203    overflow: hidden;
    203204    outline: 0;
    204     width: 100%;
     205    padding: 0;
     206    border: 0;
     207    width: 1px;
     208    height: 1px;
    205209}
    206210
     
    215219
    216220.wpview-wrap.selected {
    217     background-color: #f2f8ff; /* fallback to old blue */
    218221    background-color: rgba(0,0,0,0.1);
     222    border-color: rgba(0,0,0,0.3);
     223}
     224
     225.ie8 .wpview-wrap.selected,
     226.ie7 .wpview-wrap.selected {
     227    background-color: #e5e5e5;
    219228    border-color: #777;
    220     border-color: rgba(0,0,0,0.3);
    221229}
    222230
     
    264272}
    265273
     274.ie8 .wpview-wrap .toolbar div,
     275.ie7 .wpview-wrap .toolbar div,
     276.ie8 #wp-image-toolbar div,
     277.ie7 #wp-image-toolbar div {
     278    display: inline;
     279    padding: 0;
     280}
     281
     282.ie8 .dashicons-edit,
     283.ie7 .dashicons-edit {
     284    background-image: url(images/dashicon-edit.png);
     285}
     286
     287.ie8 .dashicons-no-alt,
     288.ie7 .dashicons-no-alt {
     289    background-image: url(images/dashicon-no-alt.png);
     290}
     291
     292
    266293.wpview-wrap .toolbar div:hover,
    267294#wp-image-toolbar div:hover {
     
    319346}
    320347
     348.ie7 .gallery,
     349.ie8 .gallery {
     350    margin: auto;
     351}
     352
    321353.gallery-error {
    322354    border: 1px solid #dedede;
     
    353385}
    354386
     387.ie7 .gallery .gallery-item,
     388.ie8 .gallery .gallery-item {
     389    padding: 6px 0;
     390}
     391
    355392.gallery .gallery-caption,
    356393.gallery .gallery-icon {
     
    375412}
    376413
     414.ie8 .gallery-columns-3 .gallery-item,
     415.ie7 .gallery-columns-3 .gallery-item {
     416    width: 33%;
     417}
     418
    377419.gallery-columns-4 .gallery-item {
    378420    width: 25%;
     
    384426
    385427.gallery-columns-6 .gallery-item {
    386     width: 16.667%;
     428    width: 16.665%;
    387429}
    388430
Note: See TracChangeset for help on using the changeset viewer.