Ticket #25821: 25821.5.patch
File 25821.5.patch, 5.2 KB (added by , 11 years ago) |
---|
-
src/wp-admin/css/wp-admin.css
10218 10218 10219 10219 #available-widgets .widget .widget-description { 10220 10220 display: block; 10221 padding: 10px 16px;10222 font-size: 12px;10221 padding: 10px 16px; 10222 font-size: 12px; 10223 10223 } 10224 10224 10225 10225 /* Inactive Sidebars */ … … 10524 10524 } 10525 10525 10526 10526 10527 /* Widgets Area Chooser merge*/10527 /* Widgets Area Chooser */ 10528 10528 .widget-liquid-left #widgets-left.chooser #available-widgets .widget, 10529 10529 .widget-liquid-left #widgets-left.chooser .inactive-sidebar { 10530 transition: opacity 0. 2s ease-in-out;10530 transition: opacity 0.1s linear; 10531 10531 } 10532 10532 10533 10533 .widget-liquid-left #widgets-left.chooser #available-widgets .widget, … … 10552 10552 #widgets-chooser { 10553 10553 clear: both; 10554 10554 display: none; 10555 margin: auto;10556 padding-bottom: 10px;10557 10555 max-width: 400px; 10558 10556 } 10559 10557 10560 10558 #widgets-chooser h3 { 10561 font-size: 14px; 10562 margin: 15px 0; 10559 font-size: 12px; 10560 padding: 15px 0 12px 35px; 10561 margin: 0; 10562 border-top: 1px solid #ccc; 10563 background: rgba(0,0,0,0.6); 10564 color: #fff; 10563 10565 } 10564 10566 10565 10567 #widgets-chooser ul.widgets-chooser-sidebars { 10566 margin: 0 0 20px 0;10568 margin: 0; 10567 10569 list-style-type: none; 10570 max-height: 300px; 10571 overflow: auto; 10568 10572 } 10569 10573 10570 #widgets-chooser ul.widgets-chooser-sidebarsli {10574 #widgets-chooser li { 10571 10575 padding: 10px 15px 10px 35px; 10572 10576 background: #fff; 10573 border: 1px solid #ccc; 10574 border-bottom: none; 10577 border-bottom: 1px solid #ccc; 10575 10578 margin: 0; 10576 10579 cursor: pointer; 10580 outline: none; 10581 position: relative; 10582 transition: background: 0.2s ease-in-out; 10577 10583 } 10578 10584 10579 #widgets-chooser ul.widgets-chooser-sidebarsli:hover {10585 #widgets-chooser li:hover { 10580 10586 background: rgba(255,255,255,0.7); 10581 10587 } 10582 10588 10583 #widgets-chooser ul.widgets-chooser-sidebars li.widgets-chooser-selected { 10584 background: #1075a0; 10585 color: #fff; 10586 position: relative; 10589 #widgets-chooser li:focus { 10590 background: rgba(255,255,255,0.7); 10587 10591 } 10588 10592 10589 #widgets-chooser ul.widgets-chooser-sidebars li.widgets-chooser-selected:before {10593 #widgets-chooser li:focus:before { 10590 10594 content: '\f147'; 10591 10595 display: block; 10592 10596 -webkit-font-smoothing: antialiased; 10593 10597 font: normal 26px/1 'dashicons'; 10598 color: #999; 10594 10599 position: absolute; 10595 10600 top: 7px; 10596 10601 left: 5px; 10597 10602 } 10598 10603 10599 #widgets-chooser ul.widgets-chooser-sidebars li:last-child { 10600 border-bottom: 1px solid #ccc; 10604 #widgets-chooser li.widgets-chooser-selected { 10605 background: #1075a0; 10606 color: #fff; 10601 10607 } 10602 10608 10603 #widgets-chooser select { 10604 width: 100%; 10605 margin-bottom: 20px; 10606 -webkit-box-sizing: border-box; 10607 -moz-box-sizing: border-box; 10608 box-sizing: border-box; 10609 #widgets-chooser li.widgets-chooser-selected:before, 10610 #widgets-chooser li.widgets-chooser-selected:focus:before { 10611 content: '\f147'; 10612 display: block; 10613 -webkit-font-smoothing: antialiased; 10614 font: normal 26px/1 'dashicons'; 10615 color: #fff; 10616 position: absolute; 10617 top: 7px; 10618 left: 5px; 10609 10619 } 10610 10620 10611 #widgets-chooser .sidebar-radios {10612 text-align: left;10613 margin: 0 20px 20px 20px;10614 }10615 10616 #widgets-chooser .sidebar-radios li {10617 margin-top: 15px;10618 }10619 10620 #widgets-chooser .sidebar-radios label {10621 font-size: 15px;10622 }10623 10624 #widgets-chooser .sidebar-radios input {10625 margin-right: 10px;10626 }10627 10628 10621 #widgets-chooser .widgets-chooser-actions { 10629 10622 clear: both; 10623 padding: 10px 0 12px 0; 10630 10624 text-align: center; 10631 10625 } 10632 10626 -
src/wp-admin/js/widgets.js
204 204 $( '#widgets-left' ).addClass( 'chooser' ); 205 205 widget.addClass( 'widget-in-question' ); 206 206 207 widget. after( chooser );208 chooser.slideDown( 200, function() {207 widget.find( '.widget-description' ).after( chooser ); 208 chooser.slideDown( 300, function() { 209 209 selectSidebar.find('.widgets-chooser-selected').focus(); 210 210 }); 211 212 selectSidebar.find( 'li' ).on( 'focusin', function() { 213 selectSidebar.find('.widgets-chooser-selected').removeClass( 'widgets-chooser-selected' ); 214 $(this).addClass( 'widgets-chooser-selected' ); 215 } ) 211 216 } 212 217 }); 213 218 … … 225 230 $target.addClass( 'widgets-chooser-selected' ); 226 231 } 227 232 }); 233 234 $(document).keypress(function(e) { 235 if ( chooser.is( ':visible' ) ) { 236 if(e.which == 13) { 237 $( '.widgets-chooser-actions .button-primary' ).click(); 238 } 239 } 240 }); 228 241 }, 229 242 230 243 saveOrder : function(sb) { … … 344 357 sidebarId = chooser.find( '.widgets-chooser-selected' ).data('sidebarId'), 345 358 sidebar = $( '#' + sidebarId ); 346 359 360 widget.find( '#widgets-chooser' ).remove(); 361 347 362 if ( 'multi' === add ) { 348 363 widget.html( 349 364 widget.html().replace( /<[^<>]+>/g, function(m) { -
src/wp-admin/widgets.php
407 407 </div> 408 408 409 409 <div id="widgets-chooser"> 410 <h3><?php _e( 'Choose a n area to place this widget…' ); ?></h3>410 <h3><?php _e( 'Choose a sidebar:' ); ?></h3> 411 411 <ul class="widgets-chooser-sidebars"></ul> 412 412 <div class="widgets-chooser-actions"> 413 <button class="button-secondary"><?php _e( 'Cancel' ); ?></button> 413 414 <button class="button-primary"><?php _e( 'Add Widget' ); ?></button> 414 <button class="button-secondary"><?php _e( 'Cancel' ); ?></button>415 415 </div> 416 416 </div> 417 417