Changeset 5072
- Timestamp:
- 03/18/08 06:13:08 (9 months ago)
- Location:
- trunk/ui
- Files:
-
- 2 modified
-
tests/resizable.html (modified) (2 diffs)
-
ui.resizable.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/tests/resizable.html
r5000 r5072 69 69 } 70 70 71 .ui-resizable-knob { 72 border: 1px #fff dashed; 73 } 74 71 75 </style> 72 76 </head> … … 201 205 202 206 //ghost: true, 207 208 knobHandles: true, 203 209 204 210 //animate:true, -
trunk/ui/ui.resizable.js
r4983 r5072 36 36 disableSelection: true, 37 37 preserveCursor: true, 38 autohide: false 38 autohide: false, 39 knobHandles: false 39 40 }, options); 40 41 … … 46 47 // force proxy if animation is enabled 47 48 this.options.proxy = this.options.proxy || this.options.animate ? 'proxy' : null; 49 50 // if knobHandles equals true set to ui-resizable-knob-handle 51 this.options.knobHandles = this.options.knobHandles === true ? 'ui-resizable-knob-handle' : this.options.knobHandles; 48 52 49 53 $(element).bind("setData.resizable", function(event, key, value){ … … 60 64 o.defaultTheme = { 61 65 'ui-resizable': { display: 'block' }, 62 'ui-resizable-handle': { position: 'absolute', background: '#F 5F5F5', fontSize: '0.1px' },66 'ui-resizable-handle': { position: 'absolute', background: '#F2F2F2', fontSize: '0.1px' }, 63 67 'ui-resizable-n': { cursor: 'n-resize', height: '4px', left: '0px', right: '0px', borderTop: aBorder }, 64 68 'ui-resizable-s': { cursor: 's-resize', height: '4px', left: '0px', right: '0px', borderBottom: aBorder }, … … 70 74 'ui-resizable-nw': { cursor: 'nw-resize', width: '4px', height: '4px', borderLeft: aBorder, borderTop: aBorder } 71 75 }; 76 77 o.knobTheme = { 78 'ui-resizable-handle': { background: '#F2F2F2', border: '1px solid #808080', height: '7px', width: '7px' }, 79 'ui-resizable-n': { cursor: 'n-resize', top: '-4px', left: '45%' }, 80 'ui-resizable-s': { cursor: 's-resize', bottom: '-4px', left: '45%' }, 81 'ui-resizable-e': { cursor: 'e-resize', right: '-4px', top: '45%' }, 82 'ui-resizable-w': { cursor: 'w-resize', left: '-4px', top: '45%' }, 83 'ui-resizable-se': { cursor: 'se-resize', right: '-4px', bottom: '-4px' }, 84 'ui-resizable-sw': { cursor: 'sw-resize', left: '-4px', bottom: '-4px' }, 85 'ui-resizable-nw': { cursor: 'nw-resize', left: '-4px', top: '-4px' }, 86 'ui-resizable-ne': { cursor: 'ne-resize', right: '-4px', top: '-4px' } 87 }; 72 88 73 89 //Position the node … … 112 128 113 129 o.zIndex = o.zIndex || 1000; 114 115 var insertions = { 116 handle: 'overflow:hidden; position:absolute;', 130 131 // insertions are applied when don't have theme loaded 132 var insertionsDefault = { 133 handle: 'position: absolute; display: none; overflow:hidden;', 117 134 n: 'top: 0pt; width:100%;', 118 135 e: 'right: 0pt; height:100%;', … … 126 143 127 144 for(var i = 0; i < n.length; i++) { 128 var d = jQuery.trim(n[i]), t = o.defaultTheme, hname = 'ui-resizable-'+d, rcss = $.extend(t[hname], t['ui-resizable-handle']), 129 axis = $(['<div class="ui-resizable-handle ', hname, '" style="',insertions[d], insertions.handle, '"></div>'].join('')).css(/sw|se|ne|nw/.test(d) ? { zIndex: ++o.zIndex } : {}); 130 131 o.handles[d] = '.ui-resizable-'+d; 145 var handle = jQuery.trim(n[i]), dt = o.defaultTheme, hname = 'ui-resizable-'+handle, loadDefault = !$.ui.css(hname) && !o.knobHandles, userKnobClass = $.ui.css('ui-resizable-knob-handle'), 146 allDefTheme = $.extend(dt[hname], dt['ui-resizable-handle']), allKnobTheme = $.extend(o.knobTheme[hname], !userKnobClass ? o.knobTheme['ui-resizable-handle'] : {}); 147 148 // increase zIndex of sw, se, ne, nw axis 149 var applyZIndex = /sw|se|ne|nw/.test(handle) ? { zIndex: ++o.zIndex } : {}; 150 151 var defCss = (loadDefault ? insertionsDefault[handle] : ''), 152 axis = $(['<div class="ui-resizable-handle ', hname, '" style="', defCss, insertionsDefault.handle, '"></div>'].join('')).css( applyZIndex ); 153 o.handles[handle] = '.ui-resizable-'+handle; 132 154 133 155 this.element.append( 134 156 //Theme detection, if not loaded, load o.defaultTheme 135 axis.css( !$.ui.css(hname) ? rcss : {} ) 157 axis.css( loadDefault ? allDefTheme : {} ) 158 // Load the knobHandle css, fix width, height, top, left... 159 .css( o.knobHandles ? allKnobTheme : {} ).addClass('ui-resizable-knob-handle').addClass(o.knobHandles) 136 160 ); 137 161 } 162 163 if (o.knobHandles) this.element.addClass('ui-resizable-knob').css( !$.ui.css('ui-resizable-knob') ? { /*border: '1px #fff dashed'*/ } : {} ); 138 164 } 139 165
