Changeset 22208
- Timestamp:
- 10/11/2012 11:52:09 PM (12 years ago)
- Location:
- trunk/wp-includes/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/mce-view.js
r22173 r22208 360 360 }, 361 361 362 // ### Select a view. 363 // 364 // Accepts a MCE view wrapper `node` (i.e. a node with the 365 // `wp-view-wrap` class). 366 select: function( node ) { 367 var $node = $(node); 368 369 // Bail if node is already selected. 370 if ( $node.hasClass('selected') ) 371 return; 372 373 $node.addClass('selected'); 374 $( node.firstChild ).trigger('select'); 375 }, 376 377 // ### Deselect a view. 378 // 379 // Accepts a MCE view wrapper `node` (i.e. a node with the 380 // `wp-view-wrap` class). 381 deselect: function( node ) { 382 var $node = $(node); 383 384 // Bail if node is already selected. 385 if ( ! $node.hasClass('selected') ) 386 return; 387 388 $node.removeClass('selected'); 389 $( node.firstChild ).trigger('deselect'); 390 }, 391 362 392 // Link any localized strings. 363 393 l10n: _.isUndefined( _wpMceViewL10n ) ? {} : _wpMceViewL10n -
trunk/wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js
r21961 r22208 4 4 5 5 (function() { 6 7 6 8 tinymce.create('tinymce.plugins.wpView', { 7 9 init : function( editor, url ) { 8 var wpView = this; 10 var wpView = this, 11 selected; 9 12 10 13 // Check if the `wp.mce` API exists. … … 62 65 o.content = wp.mce.view.toText( o.content ); 63 66 }); 67 68 // Triggers when the selection is changed. 69 editor.onNodeChange.add( function( editor, controlManager, node, collapsed, o ) { 70 var view = wpView.getParentView( node ); 71 72 // If we've clicked off of the selected view, deselect it. 73 if ( selected && selected !== view ) 74 wp.mce.view.deselect( selected ); 75 76 // Bail if we're not selecting another view. 77 if ( ! view ) 78 return; 79 80 // Update the selected view. 81 selected = view; 82 wp.mce.view.select( selected ); 83 84 // Prevent the selection from propagating to other plugins. 85 return false; 86 }); 87 }, 88 89 getParentView : function( node ) { 90 while ( node ) { 91 if ( /(?:^|\s)wp-view-wrap(?:\s|$)/.test( node.className ) ) 92 return node; 93 94 node = node.parentNode; 95 } 64 96 }, 65 97 -
trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
r22154 r22208 177 177 overflow: hidden; 178 178 179 -webkit-transition: opacity 100ms ease-in-out; 180 -moz-transition: opacity 100ms ease-in-out; 181 -ms-transition: opacity 100ms ease-in-out; 182 -o-transition: opacity 100ms ease-in-out; 183 transition: opacity 100ms ease-in-out; 184 } 185 186 .wp-view-wrap:hover .overlay { 179 -webkit-transition: opacity 100ms ease-in-out, background 150ms; 180 -moz-transition: opacity 100ms ease-in-out, background 150ms; 181 -ms-transition: opacity 100ms ease-in-out, background 150ms; 182 -o-transition: opacity 100ms ease-in-out, background 150ms; 183 transition: opacity 100ms ease-in-out, background 150ms; 184 } 185 186 .wp-view-wrap:hover .overlay, 187 .wp-view-wrap.selected .overlay { 187 188 opacity: 1; 189 } 190 .wp-view-wrap.selected .overlay { 191 background: rgba( 0, 86, 132, 0.3 ); 188 192 } 189 193 … … 227 231 } 228 232 229 .wp-view-wrap .close,230 .wp-view-wrap .edit {231 display: none;232 }233 234 233 .wp-view-wrap .close { 235 234 top: 5px; … … 244 243 right: 5px; 245 244 padding: 0 10px; 246 }247 248 .editor-attachment:hover .close,249 .editor-gallery:hover .close,250 .editor-gallery:hover .edit {251 display: block;252 245 } 253 246
Note: See TracChangeset
for help on using the changeset viewer.