From 1b891501f2c5e7e6f99839121e210aa38557dad6 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Thu, 22 Jan 2009 13:10:18 +0000 Subject: [PATCH] whitespace --- ui/effects.core.js | 24 +++++------ ui/effects.pulsate.js | 2 +- ui/ui.accordion.js | 98 +++++++++++++++++++++---------------------- ui/ui.core.js | 2 +- ui/ui.datepicker.js | 12 +++--- ui/ui.draggable.js | 22 +++++----- ui/ui.resizable.js | 2 +- ui/ui.slider.js | 16 +++---- ui/ui.sortable.js | 40 +++++++++--------- ui/ui.tabs.js | 10 ++--- 10 files changed, 114 insertions(+), 114 deletions(-) diff --git a/ui/effects.core.js b/ui/effects.core.js index 21be00a96..33327c9a0 100644 --- a/ui/effects.core.js +++ b/ui/effects.core.js @@ -13,26 +13,26 @@ $.effects = $.effects || {}; //Add the 'effects' scope $.extend($.effects, { version: "@VERSION", - + // Saves a set of properties in a data storage save: function(element, set) { for(var i=0; i < set.length; i++) { if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]); } }, - + // Restores a set of previously saved properties from a data storage restore: function(element, set) { for(var i=0; i < set.length; i++) { if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i])); } }, - + setMode: function(el, mode) { if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle return mode; }, - + getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value // this should be a little more flexible in the future to handle a string & hash var y, x; @@ -50,7 +50,7 @@ $.extend($.effects, { }; return {x: x, y: y}; }, - + // Wraps the element around a wrapper that copies position properties createWrapper: function(element) { @@ -134,7 +134,7 @@ $.extend($.effects, { //Extend the methods of jQuery $.fn.extend({ - + //Save old methods _show: $.fn.show, _hide: $.fn.hide, @@ -142,12 +142,12 @@ $.fn.extend({ _addClass: $.fn.addClass, _removeClass: $.fn.removeClass, _toggleClass: $.fn.toggleClass, - + // New effect methods effect: function(fx, options, speed, callback) { return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null; }, - + show: function() { if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) return this._show.apply(this, arguments); @@ -156,7 +156,7 @@ $.fn.extend({ return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); } }, - + hide: function() { if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) return this._hide.apply(this, arguments); @@ -165,7 +165,7 @@ $.fn.extend({ return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); } }, - + toggle: function(){ if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (arguments[0].constructor == Function)) return this.__toggle.apply(this, arguments); @@ -174,7 +174,7 @@ $.fn.extend({ return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]); } }, - + addClass: function(classNames, speed, easing, callback) { return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); }, @@ -190,7 +190,7 @@ $.fn.extend({ switchClass: function() { return this.morph.apply(this, arguments); }, - + // helper functions cssUnit: function(key) { var style = this.css(key), val = []; diff --git a/ui/effects.pulsate.js b/ui/effects.pulsate.js index 3d842cae6..a82bd7a99 100644 --- a/ui/effects.pulsate.js +++ b/ui/effects.pulsate.js @@ -23,7 +23,7 @@ $.effects.pulsate = function(o) { var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode var times = o.options.times || 5; // Default # of times var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; - + // Adjust if (mode == 'hide') times--; if (el.is(':hidden')) { // Show fadeIn diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js index d418cbed0..95fd55f43 100644 --- a/ui/ui.accordion.js +++ b/ui/ui.accordion.js @@ -15,7 +15,7 @@ $.widget("ui.accordion", { _init: function() { - + var o = this.options, self = this; this.running = 0; @@ -32,12 +32,12 @@ $.widget("ui.accordion", { } this.element.addClass("ui-accordion ui-widget ui-helper-reset"); - + this.groups = this.element.children().addClass("ui-accordion-group"); this.headers = this.groups.find("> :first-child").addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all") .bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); }) .bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); }); - + // wrap content elements in div against animation issues this.headers .next() @@ -48,7 +48,7 @@ $.widget("ui.accordion", { this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"); this.active.parent().addClass('ui-accordion-selected'); - + //Append icon elements $("").addClass("ui-icon " + o.icons.header).prependTo(this.headers); this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected); @@ -92,11 +92,11 @@ $.widget("ui.accordion", { if (o.event) { this.element.bind((o.event) + ".accordion", function(event) { return self._clickHandler.call(self, event); }); } - + }, destroy: function() { - + this.element .removeClass("ui-accordion ui-widget ui-helper-reset") .removeAttr("role") @@ -108,19 +108,19 @@ $.widget("ui.accordion", { .unbind(".accordion") .removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top") .removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex"); - + this.headers.find("a").removeAttr("tabindex"); this.headers.children(".ui-icon").remove(); this.headers.next().children().removeClass("ui-accordion-content").each(function() { $(this).parent().replaceWith(this); }); - + }, _keydown: function(event) { - + var o = this.options, keyCode = $.ui.keyCode; - + if (o.disabled || event.altKey || event.ctrlKey) return; @@ -154,36 +154,36 @@ $.widget("ui.accordion", { }, resize: function() { - + var o = this.options, maxHeight; if (o.fillSpace) { - + maxHeight = this.element.parent().height(); this.headers.each(function() { maxHeight -= $(this).outerHeight(); }); - + var maxPadding = 0; this.headers.next().each(function() { maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height()); }).height(maxHeight - maxPadding) .css('overflow', 'auto'); - + } else if ( o.autoHeight ) { maxHeight = 0; this.headers.next().each(function() { maxHeight = Math.max(maxHeight, $(this).outerHeight()); }).height(maxHeight); } - + }, activate: function(index) { // call clickHandler with custom event this._clickHandler({ target: this._findActive(index)[0] }); }, - + _findActive: function(selector) { return selector ? typeof selector == "number" @@ -193,12 +193,12 @@ $.widget("ui.accordion", { ? $([]) : this.headers.filter(":eq(0)"); }, - + _clickHandler: function(event) { - + var o = this.options; if (o.disabled) return false; - + // called only when using activate(false) to close all parts programmatically if (!event.target && !o.alwaysOpen) { this.active.parent().toggleClass('ui-accordion-selected'); @@ -216,16 +216,16 @@ $.widget("ui.accordion", { this._toggle(toShow, toHide, data); return false; } - + // get the click target var clicked = $(event.target); - + // due to the event delegation model, we have to check if one // of the parent elements is our actual header, and find that // otherwise stick with the initial target clicked = $( clicked.parents(o.header)[0] || clicked ); var clickedIsActive = clicked[0] == this.active[0]; - + // if animations are still active, or the active header is the target, ignore click if (this.running || (o.alwaysOpen && clickedIsActive)) { return false; @@ -233,7 +233,7 @@ $.widget("ui.accordion", { if (!clicked.is(o.header)) { return; } - + // switch classes this.active.parent().toggleClass('ui-accordion-selected'); this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all") @@ -243,7 +243,7 @@ $.widget("ui.accordion", { clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top") .find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected); } - + // find elements to show and hide var toShow = clicked.next(), toHide = this.active.next(), @@ -255,22 +255,22 @@ $.widget("ui.accordion", { oldContent: toHide }, down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] ); - + this.active = clickedIsActive ? $([]) : clicked; this._toggle(toShow, toHide, data, clickedIsActive, down); - + return false; - + }, - + _toggle: function(toShow, toHide, data, clickedIsActive, down) { var o = this.options, self = this; - + this.toShow = toShow; this.toHide = toHide; this.data = data; - + var complete = function() { if(!self) return; return self._completed.apply(self, arguments); }; // trigger changestart event @@ -280,9 +280,9 @@ $.widget("ui.accordion", { this.running = toHide.size() === 0 ? toShow.size() : toHide.size(); if (o.animated) { - + var animOptions = {}; - + if ( !o.alwaysOpen && clickedIsActive ) { animOptions = { toShow: $([]), @@ -300,25 +300,25 @@ $.widget("ui.accordion", { autoHeight: o.autoHeight || o.fillSpace }; } - + if (!o.proxied) { o.proxied = o.animated; } - + if (!o.proxiedDuration) { o.proxiedDuration = o.duration; } - + o.animated = $.isFunction(o.proxied) ? o.proxied(animOptions) : o.proxied; - + o.duration = $.isFunction(o.proxiedDuration) ? o.proxiedDuration(animOptions) : o.proxiedDuration; - + var animations = $.ui.accordion.animations, duration = o.duration, easing = o.animated; - + if (!animations[easing]) { animations[easing] = function(options) { this.slide(options, { @@ -327,43 +327,43 @@ $.widget("ui.accordion", { }); }; } - + animations[easing](animOptions); - + } else { - + if (!o.alwaysOpen && clickedIsActive) { toShow.toggle(); } else { toHide.hide(); toShow.show(); } - + complete(true); - + } - + toHide.prev().attr('aria-expanded','false').attr("tabIndex", "-1"); toShow.prev().attr('aria-expanded','true').attr("tabIndex", "0").focus(); }, - + _completed: function(cancel) { var o = this.options; - + this.running = cancel ? 0 : --this.running; if (this.running) return; - + if (o.clearStyle) { this.toShow.add(this.toHide).css({ height: "", overflow: "" }); } - + this._trigger('change', null, this.data); - + } }); diff --git a/ui/ui.core.js b/ui/ui.core.js index ce93ee778..88ee6bc9f 100644 --- a/ui/ui.core.js +++ b/ui/ui.core.js @@ -454,7 +454,7 @@ $.ui.mouse = { // however, in Safari, this causes select boxes not to be selectable // anymore, so this fix is needed ($.browser.safari || event.preventDefault()); - + return true; }, diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index 4ac3eee68..831cabc91 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -610,26 +610,26 @@ $.extend(Datepicker.prototype, { if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst) $(inst.input[0]).focus(); }, - + /* Check positioning to remain on screen. */ - _checkOffset: function(inst, offset, isFixed) { + _checkOffset: function(inst, offset, isFixed) { var dpWidth = inst.dpDiv.outerWidth(); var dpHeight = inst.dpDiv.outerHeight(); var inputWidth = inst.input ? inst.input.outerWidth() : 0; var inputHeight = inst.input ? inst.input.outerHeight() : 0; var viewWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var viewHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; - + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; - + // now check if datepicker is showing outside window viewpoint - move to a better place if so. offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0; offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(offset.top + dpHeight + inputHeight*2 - viewHeight) : 0; - + return offset; - }, + }, /* Find an object's position on the screen. */ _findPos: function(obj) { diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index e9b9142b6..d64bf7e67 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -144,7 +144,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { var dropped = false; if ($.ui.ddmanager && !this.options.dropBehaviour) dropped = $.ui.ddmanager.drop(this, event); - + //if a drop comes from outside (a sortable) if(this.dropped) { dropped = this.dropped; @@ -206,7 +206,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { //Get the offsetParent and cache its position this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); - + // This is a special case where we need to modify a offset calculated on start, since the following happened: // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that @@ -303,7 +303,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod ) }; - + }, _generatePosition: function(event) { @@ -317,7 +317,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { this.offset.relative = this._getRelativeOffset(); } - + var pageX = event.pageX; var pageY = event.pageY; @@ -325,7 +325,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { * - Position constraining - * Constrain the position to a mix of grid, containment. */ - + if(this.originalPosition) { //If we are not dragging yet, we won't check for options if(this.containment) { @@ -334,7 +334,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; } - + if(o.grid) { var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; @@ -457,18 +457,18 @@ $.ui.plugin.add("draggable", "connectToSortable", { $.each(inst.sortables, function() { if(this.instance.isOver) { - + this.instance.isOver = 0; - + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) - + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' if(this.shouldRevert) this.instance.options.revert = true; - + //Trigger the stop of the sortable this.instance._mouseStop(event); - + this.instance.options.helper = this.instance.options._helper; //If the helper has been the original item, restore properties in the sortable diff --git a/ui/ui.resizable.js b/ui/ui.resizable.js index 13bbff57c..410d9f7ca 100644 --- a/ui/ui.resizable.js +++ b/ui/ui.resizable.js @@ -520,7 +520,7 @@ $.widget("ui.resizable", $.extend({}, $.ui.mouse, { _propagate: function(n, event) { $.ui.plugin.call(this, n, [event, this.ui()]); - + (n != "resize" && this._trigger(n, event, this.ui())); }, diff --git a/ui/ui.slider.js b/ui/ui.slider.js index 24c6bff58..199932a29 100644 --- a/ui/ui.slider.js +++ b/ui/ui.slider.js @@ -34,7 +34,7 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, { this.range = $([]); if (o.range) { - + if (o.range === true) { this.range = $('
'); if (!o.values) o.values = [this._valueMin(), this._valueMin()]; @@ -54,7 +54,7 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, { (o.range == "max") && (this.orientation == "horizontal") && this.range.css({ right : 0 }); (o.range == "min") && (this.orientation == "vertical") && this.range.css({ bottom : 0 }); (o.range == "max") && (this.orientation == "vertical") && this.range.css({ top : 0 }); - + } if ($(".ui-slider-handle", this.element).length == 0) @@ -213,25 +213,25 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, { }, _mouseDrag: function(event) { - + var position = { x: event.pageX, y: event.pageY }; var normValue = this._normValueFromMouse(position); this._slide(event, this._handleIndex, normValue); return false; - + }, _mouseStop: function(event) { - + this.handles.removeClass("ui-state-active"); this._stop(event); this._change(event); this._handleIndex = null; return false; - + }, _normValueFromMouse: function(position) { @@ -260,7 +260,7 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, { normValue += this.options.step; return normValue; - + }, _start: function(event) { @@ -270,7 +270,7 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, { }, _slide: function(event, index, newVal) { - + var handle = this.handles[index]; if (this.options.values && this.options.values.length) { diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index 54b136efc..cd41d1de9 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -152,17 +152,17 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); $('body').css("cursor", o.cursor); } - + if(o.opacity) { // opacity option if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); this.helper.css("opacity", o.opacity); } - + if(o.zIndex) { // zIndex option if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); this.helper.css("zIndex", o.zIndex); } - + //Prepare scrolling if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') this.overflowOffset = this.scrollParent.offset(); @@ -209,31 +209,31 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { if(this.options.scroll) { var o = this.options, scrolled = false; if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { - + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; - + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; - + } else { - + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - + } - + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, event); } @@ -316,7 +316,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { cancel: function() { var self = this; - + if(this.dragging) { this._mouseUp(); @@ -614,11 +614,11 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { return el; }, update: function(container, p) { - + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified if(className && !o.forcePlaceholderSize) return; - + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); }; if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); }; @@ -712,7 +712,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { //Get the offsetParent and cache its position this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); - + // This is a special case where we need to modify a offset calculated on start, since the following happened: // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that @@ -807,7 +807,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod ) }; - + }, _generatePosition: function(event) { @@ -821,7 +821,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { this.offset.relative = this._getRelativeOffset(); } - + var pageX = event.pageX; var pageY = event.pageY; @@ -829,7 +829,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { * - Position constraining - * Constrain the position to a mix of grid, containment. */ - + if(this.originalPosition) { //If we are not dragging yet, we won't check for options if(this.containment) { @@ -838,7 +838,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; } - + if(o.grid) { var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; @@ -865,7 +865,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) }; - + }, _rearrange: function(event, i, a, hardRefresh) { @@ -948,7 +948,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { this.placeholder[0].parentNode.removeChild(this.placeholder[0]); if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; - + if(!noPropagation) { for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events this._trigger("stop", event, this._uiHash()); diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js index 3d566e5d1..bc6f6f0f8 100644 --- a/ui/ui.tabs.js +++ b/ui/ui.tabs.js @@ -93,7 +93,7 @@ $.widget("ui.tabs", { this.$lis = $('li:has(a[href])', this.list); this.$tabs = this.$lis.map(function() { return $('a', this)[0]; }); this.$panels = $([]); - + var self = this, o = this.options; var fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash @@ -103,15 +103,15 @@ $.widget("ui.tabs", { // inline tab if (fragmentId.test(href)) self.$panels = self.$panels.add(self._sanitizeSelector(href)); - + // remote tab else if (href != '#') { // prevent loading the page itself if href is just "#" $.data(a, 'href.tabs', href); // required for restore on destroy - + // TODO until #3808 is fixed strip fragment identifier from url // (IE fails to load from such url) $.data(a, 'load.tabs', href.replace(/#.*$/, '')); // mutable data - + var id = self._tabId(a); a.href = '#' + id; var $panel = $('#' + id); @@ -122,7 +122,7 @@ $.widget("ui.tabs", { } self.$panels = self.$panels.add($panel); } - + // invalid tab href else o.disabled.push(i + 1); -- 2.39.5