Changeset 4730
- Timestamp:
- 02/12/08 15:09:03 (1 year ago)
- Location:
- trunk/ui
- Files:
-
- 11 modified
-
ui.accordion.js (modified) (3 diffs)
-
ui.dialog.js (modified) (2 diffs)
-
ui.draggable.ext.js (modified) (3 diffs)
-
ui.draggable.js (modified) (3 diffs)
-
ui.mouse.js (modified) (1 diff)
-
ui.resizable.js (modified) (11 diffs)
-
ui.selectable.js (modified) (1 diff)
-
ui.slider.js (modified) (5 diffs)
-
ui.sortable.ext.js (modified) (2 diffs)
-
ui.sortable.js (modified) (6 diffs)
-
ui.tabs.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/ui.accordion.js
r4713 r4730 110 110 $(this.element).removeClass("ui-accordion").unbind(".ui-accordion"); 111 111 } 112 } 112 }; 113 113 114 114 function scopeCallback(callback, scope) { … … 116 116 return callback.apply(scope, arguments); 117 117 }; 118 } 118 }; 119 119 120 120 function completed(cancel) { … … 304 304 easing: "easeinout", 305 305 duration: 700 306 }) 306 }); 307 307 } 308 308 } -
trunk/ui/ui.dialog.js
r4723 r4730 170 170 var maxZ = 0; 171 171 $('.ui-dialog:visible').each(function() { 172 maxZ = Math.max(maxZ, parseInt($(this).css("z-index") ));172 maxZ = Math.max(maxZ, parseInt($(this).css("z-index"),10)); 173 173 }); 174 174 overlay.$el && overlay.$el.css('z-index', ++maxZ); … … 190 190 if (options.autoOpen) 191 191 this.open(); 192 } 192 }; 193 193 194 194 $.extend($.ui.dialog, { -
trunk/ui/ui.draggable.ext.js
r4677 r4730 150 150 151 151 ui.instance.overflowY = function(el) { 152 do { if(/auto|scroll/.test(el.css('overflow')) || /auto|scroll/.test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);152 do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode); 153 153 return $(document); 154 154 }(this); 155 155 ui.instance.overflowX = function(el) { 156 do { if(/auto|scroll/.test(el.css('overflow')) || /auto|scroll/.test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);156 do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode); 157 157 return $(document); 158 158 }(this); … … 224 224 225 225 if(ui.options.snapMode != 'inner') { 226 var ts = Math.abs(t - y2) <= 20 226 var ts = Math.abs(t - y2) <= 20; 227 227 var bs = Math.abs(b - y1) <= 20; 228 var ls = Math.abs(l - x2) <= 20 228 var ls = Math.abs(l - x2) <= 20; 229 229 var rs = Math.abs(r - x1) <= 20; 230 230 if(ts) ui.position.top = t - ui.instance.offset.top + ui.instance.clickOffset.top - ui.instance.helperProportions.height; … … 235 235 236 236 if(ui.options.snapMode != 'outer') { 237 var ts = Math.abs(t - y1) <= 20 237 var ts = Math.abs(t - y1) <= 20; 238 238 var bs = Math.abs(b - y2) <= 20; 239 var ls = Math.abs(l - x1) <= 20 239 var ls = Math.abs(l - x1) <= 20; 240 240 var rs = Math.abs(r - x2) <= 20; 241 241 if(ts) ui.position.top = t - ui.instance.offset.top + ui.instance.clickOffset.top; -
trunk/ui/ui.draggable.js
r4729 r4730 95 95 //Generate the original position 96 96 this.originalPosition = { 97 left: (r ? parseInt(this.helper.css('left') ) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)),98 top: (r ? parseInt(this.helper.css('top') ) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop))97 left: (r ? parseInt(this.helper.css('left'),10) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)), 98 top: (r ? parseInt(this.helper.css('top'),10) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)) 99 99 }; 100 100 … … 111 111 this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone().appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)) : this.element); 112 112 if(this.helper[0] != this.element[0]) this.helper.css('position', 'absolute'); 113 if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)) 113 if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); 114 114 115 115 //Find out the next positioned parent … … 131 131 //Generate the original position 132 132 this.originalPosition = { 133 left: (r ? parseInt(this.helper.css('left') ) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)),134 top: (r ? parseInt(this.helper.css('top') ) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop))133 left: (r ? parseInt(this.helper.css('left'),10) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)), 134 top: (r ? parseInt(this.helper.css('top'),10) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)) 135 135 }; 136 136 -
trunk/ui/ui.mouse.js
r4710 r4730 32 32 //Safari returns rgba(0,0,0,0) when bgcolor is not set 33 33 $.ui.cssCache[name] = !!( 34 ( /^[1-9]/.test(tmp.css('height')) || /^[1-9]/.test(tmp.css('width')) ||35 ! /none/.test(tmp.css('backgroundImage')) || !/transparent|rgba\(0, 0, 0, 0\)/.test(tmp.css('backgroundColor')))34 ((/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || 35 !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))) 36 36 ); 37 37 try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){} -
trunk/ui/ui.resizable.js
r4725 r4730 141 141 142 142 if (o.transparent) 143 o.handles[i].css({opacity:0}) 143 o.handles[i].css({opacity:0}); 144 144 145 145 //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) … … 214 214 } 215 215 }); 216 } 216 }; 217 217 218 218 $.extend($.ui.resizable.prototype, { … … 237 237 238 238 o.borderDif = o.borderDif || $.map(b, function(v, i) { 239 var border = parseInt(v )||0, padding = parseInt(p[i])||0;239 var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; 240 240 return border + padding; 241 241 }); … … 300 300 301 301 // buf fix #1749 302 if (el.is('.ui-draggable') || /absolute/.test(el.css('position'))) {302 if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { 303 303 // sOffset decides if document scrollOffset will be added to the top/left of the resizable element 304 var sOffset = $.browser.msie && !o.containment && /absolute/.test(el.css('position')) && !/relative/.test(el.parent().css('position'));304 var sOffset = $.browser.msie && !o.containment && (/absolute/).test(el.css('position')) && !(/relative/).test(el.parent().css('position')); 305 305 var dscrollt = sOffset ? o.documentScroll.top : 0, dscrolll = sOffset ? o.documentScroll.left : 0; 306 306 el.css({ position: 'absolute', top: (iniPos.top + dscrollt), left: (iniPos.left + dscrolll) }); … … 319 319 startPosition: { left: e.pageX, top: e.pageY }, 320 320 currentPosition: { 321 left: parseInt(this.helper.css('left') ) || 0,322 top: parseInt(this.helper.css('top') ) || 0321 left: parseInt(this.helper.css('left'),10) || 0, 322 top: parseInt(this.helper.css('top'),10) || 0 323 323 } 324 324 }); … … 362 362 width: (this.helper.width() - o.currentSizeDiff.width) + "px", 363 363 height: (this.helper.height() - o.currentSizeDiff.height) + "px", 364 top: ((parseInt(this.element.css('top') ) || 0) + ((parseInt(this.helper.css('top')) - this.offset.top)||0)),365 left: ((parseInt(this.element.css('left') ) || 0) + ((parseInt(this.helper.css('left')) - this.offset.left)||0))364 top: ((parseInt(this.element.css('top'),10) || 0) + ((parseInt(this.helper.css('top'),10) - this.offset.top)||0)), 365 left: ((parseInt(this.element.css('left'),10) || 0) + ((parseInt(this.helper.css('left'),10) - this.offset.left)||0)) 366 366 }; 367 367 … … 406 406 if (a == "top" && (o.axis == "ne" || o.axis == "nw")) { 407 407 //el.css('top', o.currentPosition['top'] - (el.outerHeight() - o.currentSize.height) ); 408 /*TODO*/ return 408 /*TODO*/ return; 409 409 }; 410 410 } … … 419 419 420 420 //Measure the new height and correct against min/maxHeight 421 var curheight = parseInt(el.css('height') )||0;421 var curheight = parseInt(el.css('height'),10)||0; 422 422 if(o.minHeight && curheight <= o.minHeight) el.css('height', o.minHeight); 423 423 if(o.maxHeight && curheight >= o.maxHeight) el.css('height', o.maxHeight); … … 427 427 428 428 //Measure the new top position and correct against min/maxHeight 429 var curtop = parseInt(el.css('top') )||0;430 431 tminval = (o.currentPosition.top + (o.currentSize.height - o.minHeight)) ,432 tmaxval = (o.currentPosition.top + (o.currentSize.height - o.maxHeight));429 var curtop = parseInt(el.css('top'),10)||0; 430 431 tminval = (o.currentPosition.top + (o.currentSize.height - o.minHeight)); 432 tmaxval = (o.currentPosition.top + (o.currentSize.height - o.maxHeight)); 433 433 if(o.minHeight && curtop >= tminval) el.css('top', tminval); 434 434 if(o.maxHeight && curtop <= tmaxval) el.css('top', tmaxval); … … 439 439 440 440 //Measure the new width and correct against min/maxWidth 441 var curwidth = parseInt(el.css('width') )||0;441 var curwidth = parseInt(el.css('width'),10)||0; 442 442 if(o.minWidth && curwidth <= o.minWidth) el.css('width', o.minWidth); 443 443 if(o.maxWidth && curwidth >= o.maxWidth) el.css('width', o.maxWidth); … … 447 447 448 448 //Measure the new left position and correct against min/maxWidth 449 var curleft = parseInt(el.css('left') )||0;450 451 tminval = (o.currentPosition.left + (o.currentSize.width - o.minWidth)) ,452 tmaxval = (o.currentPosition.left + (o.currentSize.width - o.maxWidth));449 var curleft = parseInt(el.css('left'),10)||0; 450 451 tminval = (o.currentPosition.left + (o.currentSize.width - o.minWidth)); 452 tmaxval = (o.currentPosition.left + (o.currentSize.width - o.maxWidth)); 453 453 if(o.minWidth && curleft >= tminval) el.css('left', tminval); 454 454 if(o.maxWidth && curleft <= tmaxval) el.css('left', tmaxval); -
trunk/ui/ui.selectable.js
r4689 r4730 60 60 }); 61 61 }); 62 } 62 }; 63 63 this.refresh(); 64 64 -
trunk/ui/ui.slider.js
r4718 r4730 32 32 $.extend(o, { 33 33 axis: o.axis || (element.offsetWidth < element.offsetHeight ? 'vertical' : 'horizontal'), 34 maxValue: !isNaN(parseInt(o.maxValue )) ? parseInt(o.maxValue) : 100,35 minValue: parseInt(o.minValue ) || 0,36 startValue: parseInt(o.startValue ) || 'none'34 maxValue: !isNaN(parseInt(o.maxValue,10)) ? parseInt(o.maxValue,10) : 100, 35 minValue: parseInt(o.minValue,10) || 0, 36 startValue: parseInt(o.startValue,10) || 'none' 37 37 }); 38 38 … … 41 41 42 42 //Calculate stepping based on steps 43 o.stepping = parseInt(o.stepping ) || (o.steps ? o.realMaxValue/o.steps : 0);43 o.stepping = parseInt(o.stepping,10) || (o.steps ? o.realMaxValue/o.steps : 0); 44 44 45 45 $(element).bind("setData.slider", function(event, key, value){ … … 110 110 .addClass('ui-slider-range') 111 111 .css({ position: 'absolute' }) 112 .css(this.properties[0], parseInt($(this.handle[0]).css(this.properties[0]) ) + this.handleSize(0)/2)113 .css(this.properties[1], parseInt($(this.handle[1]).css(this.properties[0]) ) - parseInt($(this.handle[0]).css(this.properties[0])))112 .css(this.properties[0], parseInt($(this.handle[0]).css(this.properties[0]),10) + this.handleSize(0)/2) 113 .css(this.properties[1], parseInt($(this.handle[1]).css(this.properties[0]),10) - parseInt($(this.handle[0]).css(this.properties[0]),10)) 114 114 .appendTo(this.element); 115 115 }, 116 116 updateRange: function() { 117 this.rangeElement.css(this.properties[0], parseInt($(this.handle[0]).css(this.properties[0]) ) + this.handleSize(0)/2);118 this.rangeElement.css(this.properties[1], parseInt($(this.handle[1]).css(this.properties[0]) ) - parseInt($(this.handle[0]).css(this.properties[0])));117 this.rangeElement.css(this.properties[0], parseInt($(this.handle[0]).css(this.properties[0]),10) + this.handleSize(0)/2); 118 this.rangeElement.css(this.properties[1], parseInt($(this.handle[1]).css(this.properties[0]),10) - parseInt($(this.handle[0]).css(this.properties[0]),10)); 119 119 }, 120 120 getRange: function() { 121 return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.properties[1]) )) : null;121 return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.properties[1]),10)) : null; 122 122 }, 123 123 ui: function(e) { … … 159 159 value: function(handle) { 160 160 if(this.handle.length == 1) this.currentHandle = this.handle; 161 return ((parseInt($(handle != undefined ? this.handle[handle] || handle : this.currentHandle).css(this.properties[0]) ) / (this.size - this.handleSize())) * this.options.realMaxValue) + this.options.minValue;161 return ((parseInt($(handle != undefined ? this.handle[handle] || handle : this.currentHandle).css(this.properties[0]),10) / (this.size - this.handleSize())) * this.options.realMaxValue) + this.options.minValue; 162 162 }, 163 163 convertValue: function(value) { … … 239 239 if(handle != undefined) this.currentHandle = this.previousHandle = $(this.handle[handle] || handle); 240 240 241 if(value.constructor == String) value = /\-\=/.test(value) ? this.value() - parseInt(value.replace('-=', '') ) : this.value() + parseInt(value.replace('+=', ''));241 if(value.constructor == String) value = /\-\=/.test(value) ? this.value() - parseInt(value.replace('-=', ''),10) : this.value() + parseInt(value.replace('+=', ''),10); 242 242 if(o.stepping) value = Math.round(value / o.stepping) * o.stepping; 243 243 value = this.translateValue(value); -
trunk/ui/ui.sortable.ext.js
r4620 r4730 52 52 53 53 ui.helper.animate({ 54 left: cur.left - self.offsetParentOffset.left - (parseInt(self.currentItem.css('marginLeft') ) || 0),55 top: cur.top - self.offsetParentOffset.top - (parseInt(self.currentItem.css('marginTop') ) || 0)54 left: cur.left - self.offsetParentOffset.left - (parseInt(self.currentItem.css('marginLeft'),10) || 0), 55 top: cur.top - self.offsetParentOffset.top - (parseInt(self.currentItem.css('marginTop'),10) || 0) 56 56 }, parseInt(ui.options.revert, 10) || 500, function() { 57 57 self.currentItem.css('visibility', 'visible'); … … 132 132 133 133 ui.instance.overflowY = function(el) { 134 do { if( /auto|scroll/.test(el.css('overflow')) || /auto|scroll/.test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);134 do { if((/auto|scroll/).test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode); 135 135 return $(document); 136 136 }(this); 137 137 ui.instance.overflowX = function(el) { 138 do { if( /auto|scroll/.test(el.css('overflow')) || /auto|scroll/.test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);138 do { if((/auto|scroll/).test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode); 139 139 return $(document); 140 140 }(this); -
trunk/ui/ui.sortable.js
r4728 r4730 59 59 60 60 //Let's determine the parent's offset 61 if(! /(relative|absolute|fixed)/.test(this.element.css('position'))) this.element.css('position', 'relative');61 if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative'); 62 62 this.offset = this.element.offset({ border: false }); 63 63 … … 112 112 113 113 items.each(function() { 114 var res = (this.getAttribute(o.attribute || 'id') || '').match(o.expression || /(.+)[-=_](.+)/);114 var res = (this.getAttribute(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); 115 115 if(res) str.push(res[1]+'[]='+res[2]); 116 116 }); … … 201 201 //Generate the original position 202 202 this.originalPosition = { 203 left: (r ? parseInt(this.helper.css('left') ) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)),204 top: (r ? parseInt(this.helper.css('top') ) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop))203 left: (r ? parseInt(this.helper.css('left'),10) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)), 204 top: (r ? parseInt(this.helper.css('top'),10) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)) 205 205 }; 206 206 207 207 //Generate a flexible offset that will later be subtracted from e.pageX/Y 208 208 this.offset = { 209 left: this._pageX - this.originalPosition.left + (parseInt(this.currentItem.css('marginLeft') ) || 0),210 top: this._pageY - this.originalPosition.top + (parseInt(this.currentItem.css('marginTop') ) || 0)209 left: this._pageX - this.originalPosition.left + (parseInt(this.currentItem.css('marginLeft'),10) || 0), 210 top: this._pageY - this.originalPosition.top + (parseInt(this.currentItem.css('marginTop'),10) || 0) 211 211 }; 212 212 … … 221 221 //Create and append the visible helper 222 222 this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone(); 223 this.helper.appendTo(this.currentItem[0].parentNode).css({ position: 'absolute', clear: 'both' , float: 'none'}).addClass('ui-sortable-helper');223 this.helper.appendTo(this.currentItem[0].parentNode).css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); 224 224 225 225 //Find out the next positioned parent … … 241 241 //Generate the original position 242 242 this.originalPosition = { 243 left: (r ? parseInt(this.helper.css('left') ) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)),244 top: (r ? parseInt(this.helper.css('top') ) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop))243 left: (r ? parseInt(this.helper.css('left'),10) || 0 : elementPosition.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)), 244 top: (r ? parseInt(this.helper.css('top'),10) || 0 : elementPosition.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)) 245 245 }; 246 246 … … 248 248 //I hate margins - they need to be removed before positioning the element absolutely.. 249 249 this.offset = { 250 left: e.pageX - this.originalPosition.left + (parseInt(this.currentItem.css('marginLeft') ) || 0),251 top: e.pageY - this.originalPosition.top + (parseInt(this.currentItem.css('marginTop') ) || 0)250 left: e.pageX - this.originalPosition.left + (parseInt(this.currentItem.css('marginLeft'),10) || 0), 251 top: e.pageY - this.originalPosition.top + (parseInt(this.currentItem.css('marginTop'),10) || 0) 252 252 }; 253 253 -
trunk/ui/ui.tabs.js
r4727 r4730 17 17 $.fn.tabs = function() { 18 18 var method = typeof arguments[0] == 'string' && arguments[0]; 19 var args = method && Array.prototype.slice.call(arguments, 1) || arguments;19 var args = method && Array.prototype.slice.call(arguments, 1) || arguments; 20 20 21 21 return this.each(function() { … … 24 24 tabs[method].apply(tabs, args); 25 25 } else 26 new $.ui.tabs(this, args[0] || {});26 new $.ui.tabs(this, args[0] || {}); 27 27 }); 28 28 }; … … 109 109 110 110 this.$lis = $('li:has(a[href])', this.element); 111 this.$tabs = this.$lis.map(function() { return $('a', this)[0] });111 this.$tabs = this.$lis.map(function() { return $('a', this)[0]; }); 112 112 this.$panels = $([]); 113 113 … … 173 173 } 174 174 } else if (o.cookie) { 175 var index = parseInt($.cookie('ui-tabs' + $.data(self.element)) );175 var index = parseInt($.cookie('ui-tabs' + $.data(self.element)),10); 176 176 if (index && self.$tabs[index]) { 177 177 o.selected = index; … … 205 205 206 206 // disable click if event is configured to something else 207 if (! /^click/.test(o.event))207 if (!(/^click/).test(o.event)) 208 208 this.$tabs.bind('click', function(e) { e.preventDefault(); }); 209 209 … … 440 440 $li.css('display', 'inline-block'); 441 441 setTimeout(function() { 442 $li.css('display', 'block') 443 }, 0) 442 $li.css('display', 'block'); 443 }, 0); 444 444 } 445 445
