Changeset 26277
- Timestamp:
- 11/20/2013 01:34:41 AM (11 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/wp-admin.css
r26275 r26277 10305 10305 padding: 15px 15px; 10306 10306 } 10307 10307 10308 div#widgets-right .sidebar-name .sidebar-name-arrow:before { 10308 10309 right: 0; 10309 10310 top: 4px; 10310 10311 } 10312 10311 10313 div#widgets-right .widget-top { 10312 10314 padding: 0; 10313 10315 background: #f7f7f7; 10314 10316 } 10317 10315 10318 div#widgets-right .widget-title-action { 10316 10319 float: right; … … 10319 10322 right: 10px; 10320 10323 } 10324 10321 10325 div#widgets-right a.widget-action:after { 10322 10326 content: '\f111'; 10323 10327 color: #888; 10324 10328 } 10329 10325 10330 div#widgets-right .widget-inside { 10326 10331 border-top: 1px solid #dedede; … … 10328 10333 10329 10334 div#widgets-right .widgets-sortables { 10330 min-height: 42px !important; /* Inline styles */10331 10335 padding: 0 8px; 10332 10336 margin-bottom: 8px; 10333 10337 position: relative; 10334 10338 } 10339 10335 10340 div#widgets-right .widgets-sortables:before { 10336 10341 display: block; … … 10347 10352 font-weight: 600; 10348 10353 color: #aaa; 10354 } 10355 10356 .sidebar-name .spinner { 10357 margin: -5px 5px; 10358 float: none; 10349 10359 } 10350 10360 -
trunk/src/wp-admin/js/widgets.js
r26275 r26277 11 11 selectSidebar = chooser.find('.widgets-chooser-sidebars'), 12 12 sidebars = $('div.widgets-sortables'), 13 isRTL = !! ( 'undefined' !== typeof isRtl && isRtl ), 14 margin = ( isRTL ? 'marginRight' : 'marginLeft' ); 13 isRTL = !! ( 'undefined' !== typeof isRtl && isRtl ); 15 14 16 15 $('#widgets-right').children('.widgets-holder-wrap').children('.sidebar-name').click( function() { … … 28 27 }); 29 28 30 sidebars.each(function(){31 if ( $(this).parent().hasClass('inactive') )32 return true;33 34 var h = 50, H = $(this).children('.widget').length;35 h = h + parseInt(H * 48, 10);36 $(this).css( 'minHeight', h + 'px' );37 });38 39 29 $(document.body).bind('click.widgets-toggle', function(e){ 40 var target = $(e.target), css = { }, widget, inside, w;30 var target = $(e.target), css = { 'z-index': 100 }, widget, inside, w; 41 31 42 32 if ( target.parents('.widget-top').length && ! target.parents('#available-widgets').length ) { 43 33 widget = target.closest('div.widget'); 44 34 inside = widget.children('.widget-inside'); 45 w = parseInt( widget.find('input.widget-width').val(), 10 ); 35 targetWidth = parseInt( widget.find('input.widget-width').val(), 10 ), 36 widgetWidth = widget.width(); 46 37 47 38 if ( inside.is(':hidden') ) { 48 if ( w > 250 && inside.closest('div.widgets-sortables').length ) { 49 if ( inside.closest('div.widget-liquid-right').length ) 50 css[margin] = 235 - w + 'px'; 51 widget.css(css); 39 if ( targetWidth > 250 && ( targetWidth + 30 > widgetWidth ) && widget.closest('div.widgets-sortables').length ) { 40 if ( widget.closest('div.widget-liquid-right').length ) { 41 margin = isRTL ? 'margin-right' : 'margin-left'; 42 } else { 43 margin = isRTL ? 'margin-left' : 'margin-right'; 44 } 45 46 css[ margin ] = widgetWidth - ( targetWidth + 30 ) + 'px'; 47 widget.css( css ); 52 48 } 53 wpWidgets.fixLabels(widget);54 49 inside.slideDown('fast'); 55 50 } else { 56 51 inside.slideUp('fast', function() { 57 widget. css({'width':'', margin:''});52 widget.attr( 'style', '' ); 58 53 }); 59 54 } … … 105 100 start: function(e,ui) { 106 101 ui.item.children('.widget-inside').hide(); 107 ui.item.css({margin:'', 'width':''});108 102 }, 109 103 stop: function(e,ui) { … … 122 116 sb = $(this).attr('id'); 123 117 124 ui.item. css({margin:'', 'width':''});118 ui.item.attr( 'style', '' ); 125 119 the_id = ''; 126 120 … … 259 253 $('.spinner').hide(); 260 254 }); 261 262 this.resize();263 255 }, 264 256 … … 299 291 } else { 300 292 widget.remove(); 301 wpWidgets.resize();302 293 } 303 294 } else { … … 306 297 $('div.widget-content', widget).html(r); 307 298 wpWidgets.appendTitle(widget); 308 wpWidgets.fixLabels(widget);309 299 } 310 300 } … … 325 315 }, 326 316 327 resize : function() {328 $('div.widgets-sortables').each(function(){329 if ( $(this).parent().hasClass('inactive') )330 return true;331 332 var h = 50, H = $(this).children('.widget').length;333 h = h + parseInt(H * 48, 10);334 $(this).css( 'minHeight', h + 'px' );335 });336 },337 338 fixLabels : function(widget) {339 widget.children('.widget-inside').find('label').each(function(){340 var f = $(this).attr('for');341 if ( f && f === $('input', this).attr('id') )342 $(this).removeAttr('for');343 });344 },345 346 317 close : function(widget) { 347 widget.children('.widget-inside').slideUp('fast', function() {348 widget. css({'width':'', margin:''});318 widget.children('.widget-inside').slideUp('fast', function() { 319 widget.attr( 'style', '' ); 349 320 }); 350 321 },
Note: See TracChangeset
for help on using the changeset viewer.