@@ -12,11 +12,12 @@
}
</style>
<script src="../../../external/requirejs/require.js"></script>
<script src="../../../demos/bootstrap.js">
<script src="../../../demos/bootstrap.js"
data-modules="effect effect-explode effect-bounce effect-blind effect-drop">
$( "pre" ).each(function( index, elem ) {
$( elem )
.attr( "title", "animated tooltips" )
.tooltip( $.parseJSON( $( elem ).text() ) );
.tooltip( JSON.parse( $( elem ).text() ) );
});
</script>
</head>
@@ -13,7 +13,7 @@
padding: 0;
margin: 0;
display: block;
outline: none;
outline: 0;
}
.ui-menu .ui-menu {
position: absolute;
@@ -33,10 +33,18 @@
.ui-selectmenu-open {
display: block;
}
.ui-selectmenu-button.ui-button {
text-align: left;
.ui-selectmenu-text {
display: block;
margin-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-selectmenu-button.ui-button {
text-align: left;
white-space: nowrap;
width: 14em;
}
.ui-selectmenu-icon.ui-icon {
float: right;
margin-top: 0;
}
@@ -7,7 +7,7 @@
* http://jquery.org/license
*/

//>>label: :data
//>>label: :data Selector
//>>group: Core
//>>description: Selects elements which have data stored under the specified key.
//>>docs: http://api.jqueryui.com/data-selector/
@@ -7,7 +7,7 @@
* http://jquery.org/license
*/

//>>label: focusable
//>>label: :focusable Selector
//>>group: Core
//>>description: Selects elements which can be focused.
//>>docs: http://api.jqueryui.com/focusable-selector/
@@ -7,7 +7,7 @@
* http://jquery.org/license
*/

//>>label: focusable
//>>label: :tabbable Selector
//>>group: Core
//>>description: Selects elements which can be tabbed to.
//>>docs: http://api.jqueryui.com/tabbable-selector/
@@ -373,7 +373,14 @@ return $.widget( "ui.accordion", {
maxHeight = 0;
this.headers.next()
.each( function() {
var isVisible = $( this ).is( ":visible" );
if ( !isVisible ) {
$( this ).show();
}
maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
if ( !isVisible ) {
$( this ).hide();
}
} )
.height( maxHeight );
}
@@ -82,7 +82,7 @@ $.widget( "ui.autocomplete", {
// Inputs are always single-line, even if inside a contentEditable element
// IE also treats inputs as contentEditable
// All other element types are determined by whether or not they're contentEditable
this.isMultiLine = isTextarea || !isInput && this.element.prop( "isContentEditable" );
this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );

this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
this.isNewMenu = true;
@@ -614,6 +614,24 @@ $.widget( "ui.autocomplete", {
// Prevents moving cursor to beginning/end of the text field in some browsers
event.preventDefault();
}
},

// Support: Chrome <=50
// We should be able to just use this.element.prop( "isContentEditable" )
// but hidden elements always report false in Chrome.
// https://code.google.com/p/chromium/issues/detail?id=313082
_isContentEditable: function( element ) {
if ( !element.length ) {
return false;
}

var editable = element.prop( "contentEditable" );

if ( editable === "inherit" ) {
return this._isContentEditable( element.parent() );
}

return editable === "true";
}
} );

@@ -115,7 +115,9 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {

if ( checked ) {
this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
this._addClass( this.icon, null, "ui-state-hover" );
if ( this.icon ) {
this._addClass( this.icon, null, "ui-state-hover" );
}
}

this._on( {
@@ -143,14 +143,19 @@ $.widget( "ui.draggable", $.ui.mouse, {
},

_blurActiveElement: function( event ) {

// Only need to blur if the event occurred on the draggable itself, see #10527
if ( !this.handleElement.is( event.target ) ) {
var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
target = $( event.target );

// Only blur if the event occurred on an element that is:
// 1) within the draggable handle
// 2) but not within the currently focused element
// See #10527, #12472
if ( this._getHandle( event ) && target.closest( activeElement ).length ) {
return;
}

// Blur any element that currently has focus, see #4261
$.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
$.ui.safeBlur( activeElement );
},

_mouseStart: function( event ) {
@@ -270,7 +270,7 @@ return $.widget( "ui.menu", {
},

_activate: function( event ) {
if ( !this.active.is( ".ui-state-disabled" ) ) {
if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
if ( this.active.children( "[aria-haspopup='true']" ).length ) {
this.expand( event );
} else {
@@ -487,6 +487,10 @@ return $.widget( "ui.menu", {
this._close( currentMenu );

this.blur( event );

// Work around active item staying active after menu is blurred
this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );

this.activeMenu = currentMenu;
}, this.delay );
},
@@ -498,14 +502,10 @@ return $.widget( "ui.menu", {
startMenu = this.active ? this.active.parent() : this.element;
}

var active = startMenu
.find( ".ui-menu" )
.hide()
.attr( "aria-hidden", "true" )
.attr( "aria-expanded", "false" )
.end()
.find( ".ui-state-active" ).not( ".ui-menu-item-wrapper" );
this._removeClass( active, null, "ui-state-active" );
startMenu.find( ".ui-menu" )
.hide()
.attr( "aria-hidden", "true" )
.attr( "aria-expanded", "false" );
},

_closeOnDocumentClick: function( event ) {
@@ -99,9 +99,9 @@ $.widget( "ui.resizable", $.ui.mouse, {

_create: function() {

var n, i, handle, axis, hname, margins,
that = this,
o = this.options;
var margins,
o = this.options,
that = this;
this._addClass( "ui-resizable" );

$.extend( this, {
@@ -159,6 +159,80 @@ $.widget( "ui.resizable", $.ui.mouse, {
this._proportionallyResize();
}

this._setupHandles();

if ( o.autoHide ) {
$( this.element )
.on( "mouseenter", function() {
if ( o.disabled ) {
return;
}
that._removeClass( "ui-resizable-autohide" );
that._handles.show();
} )
.on( "mouseleave", function() {
if ( o.disabled ) {
return;
}
if ( !that.resizing ) {
that._addClass( "ui-resizable-autohide" );
that._handles.hide();
}
} );
}

this._mouseInit();
},

_destroy: function() {

this._mouseDestroy();

var wrapper,
_destroy = function( exp ) {
$( exp )
.removeData( "resizable" )
.removeData( "ui-resizable" )
.off( ".resizable" )
.find( ".ui-resizable-handle" )
.remove();
};

// TODO: Unwrap at same DOM position
if ( this.elementIsWrapper ) {
_destroy( this.element );
wrapper = this.element;
this.originalElement.css( {
position: wrapper.css( "position" ),
width: wrapper.outerWidth(),
height: wrapper.outerHeight(),
top: wrapper.css( "top" ),
left: wrapper.css( "left" )
} ).insertAfter( wrapper );
wrapper.remove();
}

this.originalElement.css( "resize", this.originalResizeStyle );
_destroy( this.originalElement );

return this;
},

_setOption: function( key, value ) {
this._super( key, value );

switch ( key ) {
case "handles":
this._removeHandles();
this._setupHandles();
break;
default:
break;
}
},

_setupHandles: function() {
var o = this.options, handle, i, n, hname, axis, that = this;
this.handles = o.handles ||
( !$( ".ui-resizable-handle", this.element ).length ?
"e,s,se" : {
@@ -250,60 +324,11 @@ $.widget( "ui.resizable", $.ui.mouse, {
if ( o.autoHide ) {
this._handles.hide();
this._addClass( "ui-resizable-autohide" );
$( this.element )
.on( "mouseenter", function() {
if ( o.disabled ) {
return;
}
that._removeClass( "ui-resizable-autohide" );
that._handles.show();
} )
.on( "mouseleave", function() {
if ( o.disabled ) {
return;
}
if ( !that.resizing ) {
that._addClass( "ui-resizable-autohide" );
that._handles.hide();
}
} );
}

this._mouseInit();
},

_destroy: function() {

this._mouseDestroy();

var wrapper,
_destroy = function( exp ) {
$( exp )
.removeData( "resizable" )
.removeData( "ui-resizable" )
.off( ".resizable" )
.find( ".ui-resizable-handle" )
.remove();
};

// TODO: Unwrap at same DOM position
if ( this.elementIsWrapper ) {
_destroy( this.element );
wrapper = this.element;
this.originalElement.css( {
position: wrapper.css( "position" ),
width: wrapper.outerWidth(),
height: wrapper.outerHeight(),
top: wrapper.css( "top" ),
left: wrapper.css( "left" )
} ).insertAfter( wrapper );
wrapper.remove();
}

this.originalElement.css( "resize", this.originalResizeStyle );
_destroy( this.originalElement );

return this;
_removeHandles: function() {
this._handles.remove();
},

_mouseCapture: function( event ) {
@@ -582,7 +607,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
dw = this.originalPosition.left + this.originalSize.width,
dh = this.position.top + this.size.height,
dh = this.originalPosition.top + this.originalSize.height,
cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
if ( isminw ) {
data.width = o.minWidth;
@@ -84,7 +84,7 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
},

_drawButton: function() {
var icon, space,
var icon,
that = this,
item = this._parseOption(
this.element.find( "option:selected" ),
@@ -119,12 +119,8 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
"ui-button ui-widget" );

icon = $( "<span>" ).prependTo( this.button );
space = $( "<span> </span>" );
this._addClass( space, "ui-selectmenu-icon-space" );
this._addClass( icon, null, "ui-icon " + this.options.icons.button );
icon.after( space );

icon = $( "<span>" ).appendTo( this.button );
this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
this.buttonItem = this._renderButtonItem( item )
.appendTo( this.button );

@@ -544,8 +544,13 @@ return $.widget( "ui.slider", $.ui.mouse, {
var max = this.options.max,
min = this._valueMin(),
step = this.options.step,
aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
aboveMin = Math.round( ( max - min ) / step ) * step;
max = aboveMin + min;
if ( max > this.options.max ) {

//If max is not divisible by step, rounding off may increase its value
max -= step;
}
this.max = parseFloat( max.toFixed( this._precision() ) );
},

@@ -908,7 +908,7 @@ return $.widget( "ui.sortable", $.ui.mouse, {
floating = innermostContainer.floating || this._isFloating( this.currentItem );
posProperty = floating ? "left" : "top";
sizeProperty = floating ? "width" : "height";
axis = floating ? "clientX" : "clientY";
axis = floating ? "pageX" : "pageY";

for ( j = this.items.length - 1; j >= 0; j-- ) {
if ( !$.contains( this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) ) {
@@ -1072,7 +1072,7 @@ return $.widget( "ui.sortable", $.ui.mouse, {
0 - this.offset.relative.left - this.offset.parent.left,
0 - this.offset.relative.top - this.offset.parent.top,
o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
( o.containment === "document" ? this.document.width() : this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
( o.containment === "document" ? ( this.document.height() || document.body.parentNode.scrollHeight ) : this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
];
}