aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/autocomplete/maxheight.html1
-rw-r--r--ui/jquery.ui.datepicker.js2
-rw-r--r--ui/jquery.ui.draggable.js4
-rw-r--r--ui/jquery.ui.menu.js13
-rw-r--r--ui/jquery.ui.slider.js50
-rw-r--r--ui/jquery.ui.tabs.js46
6 files changed, 37 insertions, 79 deletions
diff --git a/demos/autocomplete/maxheight.html b/demos/autocomplete/maxheight.html
index fc0b4840c..c4f9769c3 100644
--- a/demos/autocomplete/maxheight.html
+++ b/demos/autocomplete/maxheight.html
@@ -8,6 +8,7 @@
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.position.js"></script>
+ <script src="../../ui/jquery.ui.menu.js"></script>
<script src="../../ui/jquery.ui.autocomplete.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 12323672a..662b49f86 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -1489,7 +1489,7 @@ $.extend(Datepicker.prototype, {
if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
- var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
+ var numRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
calender += '<tr>';
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index 774ea4380..d7bc09578 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -261,7 +261,7 @@ $.widget("ui.draggable", $.ui.mouse, {
_createHelper: function(event) {
var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);
if(!helper.parents('body').length)
helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
@@ -580,7 +580,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
//Now we fake the start of dragging for the sortable instance,
//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);
this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
this.instance.options.helper = function() { return ui.helper[0]; };
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index 3cc25062c..0848c6e67 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -237,15 +237,15 @@ $.widget("ui.menu", {
if ( this._hasScroll() ) {
var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true) ) || 0,
- paddingtop = parseFloat( $.curCSS( this.element[0], "paddingTop", true) ) || 0,
- offset = item.offset().top - this.element.offset().top - borderTop - paddingtop,
- scroll = this.element.attr( "scrollTop" ),
+ paddingTop = parseFloat( $.curCSS( this.element[0], "paddingTop", true) ) || 0,
+ offset = item.offset().top - this.element.offset().top - borderTop - paddingTop,
+ scroll = this.element.scrollTop(),
elementHeight = this.element.height(),
itemHeight = item.height();
if ( offset < 0 ) {
- this.element.attr( "scrollTop", scroll + offset );
+ this.element.scrollTop( scroll + offset );
} else if ( offset + itemHeight > elementHeight ) {
- this.element.attr( "scrollTop", scroll + offset - elementHeight + itemHeight );
+ this.element.scrollTop( scroll + offset - elementHeight + itemHeight );
}
}
@@ -410,7 +410,8 @@ $.widget("ui.menu", {
},
_hasScroll: function() {
- return this.element.height() < this.element.attr( "scrollHeight" );
+ // TODO: just use .prop() when we drop support for jQuery <1.6
+ return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]( "scrollHeight" );
},
select: function( event ) {
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index eb6545f62..f0b01d7c0 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -36,7 +36,11 @@ $.widget( "ui.slider", $.ui.mouse, {
_create: function() {
var self = this,
- o = this.options;
+ o = this.options,
+ existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
+ handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
+ handleCount = ( o.values && o.values.length ) || 1,
+ handles = [];
this._keySliding = false;
this._mouseSliding = false;
@@ -50,57 +54,35 @@ $.widget( "ui.slider", $.ui.mouse, {
" ui-slider-" + this.orientation +
" ui-widget" +
" ui-widget-content" +
- " ui-corner-all" );
-
- if ( o.disabled ) {
- this.element.addClass( "ui-slider-disabled ui-disabled" );
- }
+ " ui-corner-all" +
+ ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) );
this.range = $([]);
if ( o.range ) {
if ( o.range === true ) {
- this.range = $( "<div></div>" );
if ( !o.values ) {
o.values = [ this._valueMin(), this._valueMin() ];
}
if ( o.values.length && o.values.length !== 2 ) {
o.values = [ o.values[0], o.values[0] ];
}
- } else {
- this.range = $( "<div></div>" );
- }
-
- this.range
- .appendTo( this.element )
- .addClass( "ui-slider-range" );
-
- if ( o.range === "min" || o.range === "max" ) {
- this.range.addClass( "ui-slider-range-" + o.range );
}
- // note: this isn't the most fittingly semantic framework class for this element,
- // but worked best visually with a variety of themes
- this.range.addClass( "ui-widget-header" );
- }
-
- if ( $( ".ui-slider-handle", this.element ).length === 0 ) {
- $( "<a href='#'></a>" )
+ this.range = $( "<div></div>" )
.appendTo( this.element )
- .addClass( "ui-slider-handle" );
+ .addClass( "ui-slider-range" +
+ // note: this isn't the most fittingly semantic framework class for this element,
+ // but worked best visually with a variety of themes
+ " ui-widget-header" +
+ ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );
}
- if ( o.values && o.values.length ) {
- while ( $(".ui-slider-handle", this.element).length < o.values.length ) {
- $( "<a href='#'></a>" )
- .appendTo( this.element )
- .addClass( "ui-slider-handle" );
- }
+ for ( var i = existingHandles.length; i < handleCount; i += 1 ) {
+ handles.push( handle );
}
- this.handles = $( ".ui-slider-handle", this.element )
- .addClass( "ui-state-default" +
- " ui-corner-all" );
+ this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) );
this.handle = this.handles.eq( 0 );
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index cce50d3e7..86960cab6 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -401,52 +401,26 @@ $.widget( "ui.tabs", {
that.xhr.abort();
}
- // if tab may be closed
- if ( options.collapsible ) {
- if ( collapsing ) {
- options.active = false;
-
- that.element.queue( "tabs", function() {
- that._hideTab( event, eventData );
- }).dequeue( "tabs" );
-
- clicked[ 0 ].blur();
- return;
- } else if ( !toHide.length ) {
- that.element.queue( "tabs", function() {
- that._showTab( event, eventData );
- });
-
- // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
- that.load( that.anchors.index( clicked ), event );
-
- clicked[ 0 ].blur();
- return;
- }
+ if ( !toHide.length && !toShow.length ) {
+ throw "jQuery UI Tabs: Mismatching fragment identifier.";
}
- // show new tab
+ if ( toHide.length ) {
+ that.element.queue( "tabs", function() {
+ that._hideTab( event, eventData );
+ });
+ }
if ( toShow.length ) {
- if ( toHide.length ) {
- that.element.queue( "tabs", function() {
- that._hideTab( event, eventData );
- });
- }
that.element.queue( "tabs", function() {
that._showTab( event, eventData );
});
+ // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
that.load( that.anchors.index( clicked ), event );
- } else {
- throw "jQuery UI Tabs: Mismatching fragment identifier.";
- }
- // Prevent IE from keeping other link focussed when using the back button
- // and remove dotted border from clicked link. This is controlled via CSS
- // in modern browsers; blur() removes focus from address bar in Firefox
- // which can become a usability
- if ( $.browser.msie ) {
clicked[ 0 ].blur();
+ } else {
+ that.element.dequeue( "tabs" );
}
},