From 228b1b191b4f668a74e7005fc9c8c9250c090aa9 Mon Sep 17 00:00:00 2001 From: "Richard D. Worth" Date: Tue, 27 Sep 2011 07:57:06 -0400 Subject: [PATCH 01/13] Sortable: replaced hard-coded sortable with this.widgetName, and removed lines from destroy that are handled by super. Fixes #7741 - ui.sortable is not working when it is extended --- ui/jquery.ui.sortable.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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, From 25ba0e6ef39c7aebcf2f0901823470422110970f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 27 Sep 2011 12:10:17 -0400 Subject: [PATCH 02/13] Progressbar: Hide overflowing content. Fixes #7743 - Progressbar: Value div can flow out of wrapper div. --- themes/base/jquery.ui.progressbar.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base/jquery.ui.progressbar.css b/themes/base/jquery.ui.progressbar.css index 38364fafa..79d786fa7 100644 --- a/themes/base/jquery.ui.progressbar.css +++ b/themes/base/jquery.ui.progressbar.css @@ -7,5 +7,5 @@ * * http://docs.jquery.com/UI/Progressbar#theming */ -.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file From 04e5b103ca81e630bab5e072f805ef4a3fe489c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 28 Sep 2011 09:32:11 -0400 Subject: [PATCH 03/13] Tooltip: Fixed defaults in tests. --- tests/unit/tooltip/tooltip_defaults.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/tooltip/tooltip_defaults.js b/tests/unit/tooltip/tooltip_defaults.js index 4b687bdcb..b8b41bf47 100644 --- a/tests/unit/tooltip/tooltip_defaults.js +++ b/tests/unit/tooltip/tooltip_defaults.js @@ -7,7 +7,7 @@ commonWidgetTests( "tooltip", { position: { my: "left+15 center", at: "right center", - collision: "flip fit" + collision: "flipfit flipfit" }, show: true, tooltipClass: null, From 39b452e1be8d6ef9006c26be3495c633d15ff96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 28 Sep 2011 10:00:25 -0400 Subject: [PATCH 04/13] Effects tests: Ignore leading/trailing whitespace when comparing style properties. --- tests/unit/effects/effects_core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index 2b4d684eb..1e5da2113 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -143,10 +143,10 @@ asyncTest( "animateClass clears style properties when stopped", function() { expect( 2 ); test.addClass( "testChangeBackground", duration ); - notEqual( orig, style.cssText, "cssText is the not the same after starting animation" ); + notEqual( orig, style.cssText, "cssText is not the same after starting animation" ); test.stop( true, true ); - equal( orig, style.cssText, "cssText is the same after stopping animation midway" ); + equal( orig, $.trim( style.cssText ), "cssText is the same after stopping animation midway" ); start(); }); From c2f036277c6190bc8677bc0eac53c22ed5e8a08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 28 Sep 2011 18:30:58 -0400 Subject: [PATCH 05/13] Spinner: Added culture option. --- tests/unit/spinner/spinner.html | 1 + tests/unit/spinner/spinner_defaults.js | 1 + tests/unit/spinner/spinner_options.js | 25 +++++++++++++++++++++++++ ui/jquery.ui.spinner.js | 6 ++++-- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/tests/unit/spinner/spinner.html b/tests/unit/spinner/spinner.html index ddfb03d91..321c16b4c 100644 --- a/tests/unit/spinner/spinner.html +++ b/tests/unit/spinner/spinner.html @@ -9,6 +9,7 @@ + diff --git a/tests/unit/spinner/spinner_defaults.js b/tests/unit/spinner/spinner_defaults.js index 3321f8733..0a4e7c236 100644 --- a/tests/unit/spinner/spinner_defaults.js +++ b/tests/unit/spinner/spinner_defaults.js @@ -1,5 +1,6 @@ commonWidgetTests( "spinner", { defaults: { + culture: null, disabled: false, incremental: true, max: null, diff --git a/tests/unit/spinner/spinner_options.js b/tests/unit/spinner/spinner_options.js index 2b557cb69..8be57c785 100644 --- a/tests/unit/spinner/spinner_options.js +++ b/tests/unit/spinner/spinner_options.js @@ -2,6 +2,8 @@ module( "spinner: options" ); +// culture is tested after numberFormat, since it depends on numberFormat + test( "incremental, false", function() { expect( 100 ); @@ -91,6 +93,29 @@ test( "numberFormat, currency", function() { equal( element.val(), "$1.00", "formatted after step" ); }); +test( "culture, null", function() { + expect( 2 ); + Globalize.culture( "ja-JP" ); + var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "C" }); + equal( element.val(), "¥0", "formatted on init" ); + element.spinner( "stepUp" ); + equal( element.val(), "¥1", "formatted after step" ); + + // reset culture + Globalize.culture( "default" ); +}); + +test( "currency, ja-JP", function() { + expect( 2 ); + var element = $( "#spin" ).val( 0 ).spinner({ + numberFormat: "C", + culture: "ja-JP" + }); + equal( element.val(), "¥0", "formatted on init" ); + element.spinner( "stepUp" ); + equal( element.val(), "¥1", "formatted after step" ); +}); + test( "max", function() { expect( 3 ); var element = $( "#spin" ).val( 1000 ).spinner({ max: 100 }); 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: "", 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; }, From ac8a19b62d89a5b70b8ef89029ff81cdf889cf41 Mon Sep 17 00:00:00 2001 From: kborchers Date: Thu, 29 Sep 2011 14:08:42 -0500 Subject: [PATCH 06/13] Menubar: Fixed an issue with autoExpand binding that caused the menu to close on fast mouseenter by changing to _bind on the parent menubar item --- ui/jquery.ui.menubar.js | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js index 9af3aa080..b86ba298d 100644 --- a/ui/jquery.ui.menubar.js +++ b/ui/jquery.ui.menubar.js @@ -123,22 +123,6 @@ $.widget( "ui.menubar", { .attr( "aria-haspopup", "true" ) .wrapInner( "" ); - 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( "" ); @@ -169,6 +153,15 @@ $.widget( "ui.menubar", { }, 100); } }); + if ( that.options.autoExpand ) { + that._bind( { + "mouseleave .ui-menubar-item": function( event ) { + that.timer = setTimeout( function() { + that._close(); + }, 150 ); + } + }); + } }, _destroy : function() { From dda67fc171d82523fa63bc63c011ebd4351911c9 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 29 Sep 2011 18:55:58 -0400 Subject: [PATCH 07/13] Effect core: Making animate class cross-frame safe, style guidence --- ui/jquery.effects.core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 15d81b4b0..699b41d81 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, From e8ba367a58995b191706e5682eacba534cd25697 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 29 Sep 2011 20:45:23 -0400 Subject: [PATCH 08/13] Effects: fixing an animateClass issue when the class was empty --- ui/jquery.effects.core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 699b41d81..3dc0a4e67 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -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; From 1e395ecf08c8c9d24b1b676692124f9e2c2602c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 30 Sep 2011 17:06:06 -0400 Subject: [PATCH 09/13] Accordion: Fixed nested accordions. --- ui/jquery.ui.accordion.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; From 663719863f947352c03f0a8b43dceff293c4f554 Mon Sep 17 00:00:00 2001 From: David Leal Date: Sat, 1 Oct 2011 12:06:40 +0100 Subject: [PATCH 10/13] Autocomplete: Fix stray reference to element.val(). --- ui/jquery.ui.autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); } From 8d09f750a45823f7499672076eed5b19a823e309 Mon Sep 17 00:00:00 2001 From: Marian Rudzynski Date: Sat, 1 Oct 2011 10:56:49 -0400 Subject: [PATCH 11/13] Menubar: moved mouseleave _bind call into existing _bind block, added the mouseenter binding back in to help with accidental quick mouseouts causing the menu to close and use same close time for all --- ui/jquery.ui.menubar.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js index b86ba298d..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 ); @@ -150,18 +150,19 @@ $.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 ); } }); - if ( that.options.autoExpand ) { - that._bind( { - "mouseleave .ui-menubar-item": function( event ) { - that.timer = setTimeout( function() { - that._close(); - }, 150 ); - } - }); - } }, _destroy : function() { From bbcbd6899acd600906da0e0fa9e53c7623db5308 Mon Sep 17 00:00:00 2001 From: kborchers Date: Thu, 6 Oct 2011 22:58:19 -0500 Subject: [PATCH 12/13] Popup: Added tooltip style demo and link to demos index --- demos/popup/index.html | 1 + demos/popup/tooltip.html | 66 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 demos/popup/tooltip.html diff --git a/demos/popup/index.html b/demos/popup/index.html index 961585268..63636241b 100644 --- a/demos/popup/index.html +++ b/demos/popup/index.html @@ -10,6 +10,7 @@

Examples

  • Default functionality
  • +
  • Popup on hover (tooltip)
  • Popup - show/hide effects
  • Menu's as popup
  • Menu's as popup in a table
  • diff --git a/demos/popup/tooltip.html b/demos/popup/tooltip.html new file mode 100644 index 000000000..40715d874 --- /dev/null +++ b/demos/popup/tooltip.html @@ -0,0 +1,66 @@ + + + + jQuery UI Popup - Tooltip style demo + + + + + + + + + + + + + +
    +
    + +
    +
    This is some more info
    +
    + +
    + +

    A "more info" popup that works on mouseover (tooltip).

    + +
    + + + + From 647bab506e288658c8a28dab1083c657ad61951e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 8 Oct 2011 07:36:35 -0400 Subject: [PATCH 13/13] Tooltip demo: Use position option in tracking demo. --- demos/tooltip/tracking.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/demos/tooltip/tracking.html b/demos/tooltip/tracking.html index 914940086..222330838 100644 --- a/demos/tooltip/tracking.html +++ b/demos/tooltip/tracking.html @@ -19,14 +19,16 @@