diff options
author | Felix Nagel <info@felixnagel.com> | 2011-10-09 00:14:03 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2011-10-09 00:14:03 +0200 |
commit | ac54556fb3b7ab08744cc7ea663a276d5c91cdd4 (patch) | |
tree | 22fddadf4753d0e2bce4fc9528b9e1cc7cb342d8 /ui | |
parent | d7e23ce225b6fe08cfa779df0f7e70e4d95a0883 (diff) | |
parent | 647bab506e288658c8a28dab1083c657ad61951e (diff) | |
download | jquery-ui-ac54556fb3b7ab08744cc7ea663a276d5c91cdd4.tar.gz jquery-ui-ac54556fb3b7ab08744cc7ea663a276d5c91cdd4.zip |
Merge branch 'master' of github.com:jquery/jquery-ui into selectmenu
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.effects.core.js | 8 | ||||
-rw-r--r-- | ui/jquery.ui.accordion.js | 10 | ||||
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 2 | ||||
-rw-r--r-- | ui/jquery.ui.menubar.js | 30 | ||||
-rw-r--r-- | ui/jquery.ui.sortable.js | 19 | ||||
-rw-r--r-- | ui/jquery.ui.spinner.js | 6 |
6 files changed, 35 insertions, 40 deletions
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 15d81b4b0..3dc0a4e67 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -161,7 +161,7 @@ var classAnimationActions = [ "add", "remove", "toggle" ], // prefix used for storing data on .data() dataSpace = "ec.storage."; -$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function(_, prop) { +$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { $.fx.step[ prop ] = function( fx ) { if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { jQuery.style( fx.elem, prop, fx.end ); @@ -171,8 +171,8 @@ $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopS }); function getElementStyles() { - var style = document.defaultView - ? document.defaultView.getComputedStyle(this, null) + var style = this.ownerDocument.defaultView + ? this.ownerDocument.defaultView.getComputedStyle( this, null ) : this.currentStyle, newStyle = {}, key, @@ -223,7 +223,7 @@ $.effects.animateClass = function( value, duration, easing, callback ) { return this.queue( function() { var animated = $( this ), - baseClass = animated.attr( "class" ), + baseClass = animated.attr( "class" ) || "", finalClass, allAnimations = o.children ? animated.find( "*" ).andSelf() : animated; diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index c976e3e69..580009d33 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -13,8 +13,6 @@ */ (function( $, undefined ) { -var lastToggle = {}; - // TODO: use ui-accordion-header-active class and fix styling $.widget( "ui.accordion", { version: "@VERSION", @@ -39,6 +37,7 @@ $.widget( "ui.accordion", { var self = this, options = self.options; + self.lastToggle = {}; self.element.addClass( "ui-accordion ui-widget ui-helper-reset" ); self.headers = self.element.find( options.header ) @@ -378,10 +377,11 @@ $.widget( "ui.accordion", { } animations[ animation ]({ + widget: self, toShow: toShow, toHide: toHide, - prevShow: lastToggle.toShow, - prevHide: lastToggle.toHide, + prevShow: self.lastToggle.toShow, + prevHide: self.lastToggle.toHide, complete: complete, down: toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) ) }, additional ); @@ -450,7 +450,7 @@ $.extend( $.ui.accordion, { duration: 300 }, options, additions ); - lastToggle = options; + options.widget.lastToggle = options; if ( !options.toHide.size() ) { originalWidth = options.toShow[0].style.width; diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index a4bc82d28..6b06cfe2c 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -328,7 +328,7 @@ $.widget( "ui.autocomplete", { clearTimeout( self.searching ); self.searching = setTimeout(function() { // only search if the value has changed - if ( self.term != self.element.val() ) { + if ( self.term != self._value() ) { self.selectedItem = null; self.search( null, event ); } diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js index 9af3aa080..673493366 100644 --- a/ui/jquery.ui.menubar.js +++ b/ui/jquery.ui.menubar.js @@ -94,7 +94,7 @@ $.widget( "ui.menubar", { } if ( ( that.open && event.type == "mouseenter" ) || event.type == "click" || that.options.autoExpand ) { if( that.options.autoExpand ) { - clearTimeout( that.timer ); + clearTimeout( that.closeTimer ); } that._open( event, menu ); @@ -123,22 +123,6 @@ $.widget( "ui.menubar", { .attr( "aria-haspopup", "true" ) .wrapInner( "<span class='ui-button-text'></span>" ); - if ( that.options.autoExpand ) { - input.bind( "mouseleave.menubar", function( event ) { - that.timer = setTimeout( function() { - that._close(); - }, 150 ); - }); - menu.bind( "mouseleave.menubar", function( event ) { - that.timer = setTimeout( function() { - that._close(); - }, 150 ); - }) - .bind( "mouseenter.menubar", function( event ) { - clearTimeout( that.timer ); - }); - } - // TODO review if these options are a good choice, maybe they can be merged if ( that.options.menuIcon ) { input.addClass( "ui-state-default" ).append( "<span class='ui-button-icon-secondary ui-icon ui-icon-triangle-1-s'></span>" ); @@ -166,7 +150,17 @@ $.widget( "ui.menubar", { focusout: function( event ) { that.closeTimer = setTimeout( function() { that._close( event ); - }, 100); + }, 150); + }, + "mouseleave .ui-menubar-item": function( event ) { + if ( that.options.autoExpand ) { + that.closeTimer = setTimeout( function() { + that._close( event ); + }, 150); + } + }, + "mouseenter .ui-menubar-item": function( event ) { + clearTimeout( that.closeTimer ); } }); }, diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 99798a915..62d227a3d 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -63,13 +63,11 @@ $.widget("ui.sortable", $.ui.mouse, { destroy: function() { this.element - .removeClass("ui-sortable ui-sortable-disabled") - .removeData("sortable") - .unbind(".sortable"); + .removeClass("ui-sortable ui-sortable-disabled"); this._mouseDestroy(); for ( var i = this.items.length - 1; i >= 0; i-- ) - this.items[i].item.removeData("sortable-item"); + this.items[i].item.removeData(this.widgetName + "-item"); return this; }, @@ -86,6 +84,7 @@ $.widget("ui.sortable", $.ui.mouse, { }, _mouseCapture: function(event, overrideHandle) { + var that = this; if (this.reverting) { return false; @@ -98,12 +97,12 @@ $.widget("ui.sortable", $.ui.mouse, { //Find out if the clicked node (or one of its parents) is a actual item in this.items var currentItem = null, self = this, nodes = $(event.target).parents().each(function() { - if($.data(this, 'sortable-item') == self) { + if($.data(this, that.widgetName + '-item') == self) { currentItem = $(this); return false; } }); - if($.data(event.target, 'sortable-item') == self) currentItem = $(event.target); + if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target); if(!currentItem) return false; if(this.options.handle && !overrideHandle) { @@ -528,7 +527,7 @@ $.widget("ui.sortable", $.ui.mouse, { for (var i = connectWith.length - 1; i >= 0; i--){ var cur = $(connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], 'sortable'); + var inst = $.data(cur[j], this.widgetName); if(inst && inst != this && !inst.options.disabled) { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); } @@ -550,7 +549,7 @@ $.widget("ui.sortable", $.ui.mouse, { _removeCurrentsFromItems: function() { - var list = this.currentItem.find(":data(sortable-item)"); + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); for (var i=0; i < this.items.length; i++) { @@ -576,7 +575,7 @@ $.widget("ui.sortable", $.ui.mouse, { for (var i = connectWith.length - 1; i >= 0; i--){ var cur = $(connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], 'sortable'); + var inst = $.data(cur[j], this.widgetName); if(inst && inst != this && !inst.options.disabled) { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); this.containers.push(inst); @@ -592,7 +591,7 @@ $.widget("ui.sortable", $.ui.mouse, { for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { var item = $(_queries[j]); - item.data('sortable-item', targetData); // Data for target checking (mouse manager) + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) items.push({ item: item, diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index 09df97be7..31de2c9da 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -30,6 +30,7 @@ $.widget( "ui.spinner", { defaultElement: "<input>", widgetEventPrefix: "spin", options: { + culture: null, incremental: true, max: null, min: null, @@ -320,7 +321,8 @@ $.widget( "ui.spinner", { _parse: function( val ) { if ( typeof val === "string" && val !== "" ) { - val = window.Globalize && this.options.numberFormat ? Globalize.parseFloat( val ) : +val; + val = window.Globalize && this.options.numberFormat ? + Globalize.parseFloat( val, 10, this.options.culture ) : +val; } return val === "" || isNaN( val ) ? null : val; }, @@ -330,7 +332,7 @@ $.widget( "ui.spinner", { return ""; } return window.Globalize && this.options.numberFormat ? - Globalize.format( value, this.options.numberFormat ) : + Globalize.format( value, this.options.numberFormat, this.options.culture ) : value; }, |